home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / crypl200.zip / BNLIB / LBN32.H < prev    next >
Text File  |  1996-09-22  |  4KB  |  146 lines

  1. #ifndef LBN32_H
  2. #define LBN32_H
  3.  
  4. #if defined( INC_ALL ) || defined( INC_CHILD )
  5.   #include "lbn.h"
  6. #else
  7.   #include "bnlib/lbn.h"
  8. #endif /* Compiler-specific includes */
  9.  
  10. #ifndef BNWORD32
  11. #error 32-bit bignum library requires a 32-bit data type
  12. #endif
  13.  
  14. #ifndef lbnCopy_32
  15. void lbnCopy_32(BNWORD32 *dest, BNWORD32 const *src, unsigned len);
  16. #endif
  17. #ifndef lbnZero_32
  18. void lbnZero_32(BNWORD32 *num, unsigned len);
  19. #endif
  20. #ifndef lbnNeg_32
  21. void lbnNeg_32(BNWORD32 *num, unsigned len);
  22. #endif
  23.  
  24. #ifndef lbnAdd1_32
  25. BNWORD32 lbnAdd1_32(BNWORD32 *num, unsigned len, BNWORD32 carry);
  26. #endif
  27. #ifndef lbnSub1_32
  28. BNWORD32 lbnSub1_32(BNWORD32 *num, unsigned len, BNWORD32 borrow);
  29. #endif
  30.  
  31. #ifndef lbnAddN_32
  32. BNWORD32 lbnAddN_32(BNWORD32 *num1, BNWORD32 const *num2, unsigned len);
  33. #endif
  34. #ifndef lbnSubN_32
  35. BNWORD32 lbnSubN_32(BNWORD32 *num1, BNWORD32 const *num2, unsigned len);
  36. #endif
  37.  
  38. #ifndef lbnCmp_32
  39. int lbnCmp_32(BNWORD32 const *num1, BNWORD32 const *num2, unsigned len);
  40. #endif
  41.  
  42. #ifndef lbnMulN1_32
  43. void lbnMulN1_32(BNWORD32 *out, BNWORD32 const *in, unsigned len, BNWORD32 k);
  44. #endif
  45. #ifndef lbnMulAdd1_32
  46. BNWORD32
  47. lbnMulAdd1_32(BNWORD32 *out, BNWORD32 const *in, unsigned len, BNWORD32 k);
  48. #endif
  49. #ifndef lbnMulSub1_32
  50. BNWORD32 lbnMulSub1_32(BNWORD32 *out, BNWORD32 const *in, unsigned len, BNWORD32 k);
  51. #endif
  52.  
  53. #ifndef lbnLshift_32
  54. BNWORD32 lbnLshift_32(BNWORD32 *num, unsigned len, unsigned shift);
  55. #endif
  56. #ifndef lbnDouble_32
  57. BNWORD32 lbnDouble_32(BNWORD32 *num, unsigned len);
  58. #endif
  59. #ifndef lbnRshift_32
  60. BNWORD32 lbnRshift_32(BNWORD32 *num, unsigned len, unsigned shift);
  61. #endif
  62.  
  63. #ifndef lbnMul_32
  64. void lbnMul_32(BNWORD32 *prod, BNWORD32 const *num1, unsigned len1,
  65.     BNWORD32 const *num2, unsigned len2);
  66. #endif
  67. #ifndef lbnSquare_32
  68. void lbnSquare_32(BNWORD32 *prod, BNWORD32 const *num, unsigned len);
  69. #endif
  70.  
  71. #ifndef lbnNorm_32
  72. unsigned lbnNorm_32(BNWORD32 const *num, unsigned len);
  73. #endif
  74. #ifndef lbnBits_32
  75. unsigned lbnBits_32(BNWORD32 const *num, unsigned len);
  76. #endif
  77.  
  78. #ifndef lbnExtractBigBytes_32
  79. void lbnExtractBigBytes_32(BNWORD32 const *bn, unsigned char *buf,
  80.     unsigned lsbyte, unsigned buflen);
  81. #endif
  82. #ifndef lbnInsertBigytes_32
  83. void lbnInsertBigBytes_32(BNWORD32 *n, unsigned char const *buf,
  84.     unsigned lsbyte,  unsigned buflen);
  85. #endif
  86. #ifndef lbnExtractLittleBytes_32
  87. void lbnExtractLittleBytes_32(BNWORD32 const *bn, unsigned char *buf,
  88.     unsigned lsbyte, unsigned buflen);
  89. #endif
  90. #ifndef lbnInsertLittleBytes_32
  91. void lbnInsertLittleBytes_32(BNWORD32 *n, unsigned char const *buf,
  92.     unsigned lsbyte,  unsigned buflen);
  93. #endif
  94.  
  95. #ifndef lbnDiv21_32
  96. BNWORD32 lbnDiv21_32(BNWORD32 *q, BNWORD32 nh, BNWORD32 nl, BNWORD32 d);
  97. #endif
  98. #ifndef lbnDiv1_32
  99. BNWORD32 lbnDiv1_32(BNWORD32 *q, BNWORD32 *rem,
  100.     BNWORD32 const *n, unsigned len, BNWORD32 d);
  101. #endif
  102. #ifndef lbnModQ_32
  103. unsigned lbnModQ_32(BNWORD32 const *n, unsigned len, unsigned d);
  104. #endif
  105. #ifndef lbnDiv_32
  106. BNWORD32
  107. lbnDiv_32(BNWORD32 *q, BNWORD32 *n, unsigned nlen, BNWORD32 *d, unsigned dlen);
  108. #endif
  109.  
  110. #ifndef lbnMontInv1_32
  111. BNWORD32 lbnMontInv1_32(BNWORD32 const x);
  112. #endif
  113. #ifndef lbnMontReduce_32
  114. void lbnMontReduce_32(BNWORD32 *n, BNWORD32 const *mod, unsigned const mlen,
  115.                 BNWORD32 inv);
  116. #endif
  117. #ifndef lbnToMont_32
  118. void lbnToMont_32(BNWORD32 *n, unsigned nlen, BNWORD32 *mod, unsigned mlen);
  119. #endif
  120. #ifndef lbnFromMont_32
  121. void lbnFromMont_32(BNWORD32 *n, BNWORD32 *mod, unsigned len);
  122. #endif
  123.  
  124. #ifndef lbnExpMod_32
  125. int lbnExpMod_32(BNWORD32 *result, BNWORD32 const *n, unsigned nlen,
  126.     BNWORD32 const *exp, unsigned elen, BNWORD32 *mod, unsigned mlen);
  127. #endif
  128. #ifndef lbnDoubleExpMod_32
  129. int lbnDoubleExpMod_32(BNWORD32 *result,
  130.     BNWORD32 const *n1, unsigned n1len, BNWORD32 const *e1, unsigned e1len,
  131.     BNWORD32 const *n2, unsigned n2len, BNWORD32 const *e2, unsigned e2len,
  132.     BNWORD32 *mod, unsigned mlen);
  133. #endif
  134. #ifndef lbnTwoExpMod_32
  135. int lbnTwoExpMod_32(BNWORD32 *n, BNWORD32 const *exp, unsigned elen,
  136.     BNWORD32 *mod, unsigned mlen);
  137. #endif
  138. #ifndef lbnGcd_32
  139. int lbnGcd_32(BNWORD32 *a, unsigned alen, BNWORD32 *b, unsigned blen);
  140. #endif
  141. #ifndef lbnInv_32
  142. int lbnInv_32(BNWORD32 *a, unsigned alen, BNWORD32 const *mod, unsigned mlen);
  143. #endif
  144.  
  145. #endif /* LBN32_H */
  146.