Permalink
Browse files

added libtommath-0.36

  • Loading branch information...
1 parent fdfa2f4 commit 9294e7915009a2054f230bbeca405286363d05f7 Tom St Denis committed with sjaeckel Aug 1, 2005
Showing with 1,588 additions and 475 deletions.
  1. +0 −16 TODO
  2. BIN bn.pdf
  3. +1 −1 bn.tex
  4. +4 −0 bn_error.c
  5. +4 −0 bn_fast_mp_invmod.c
  6. +4 −0 bn_fast_mp_montgomery_reduce.c
  7. +5 −0 bn_fast_s_mp_mul_digs.c
  8. +4 −0 bn_fast_s_mp_mul_high_digs.c
  9. +4 −0 bn_fast_s_mp_sqr.c
  10. +4 −0 bn_mp_2expt.c
  11. +4 −0 bn_mp_abs.c
  12. +4 −0 bn_mp_add.c
  13. +4 −0 bn_mp_add_d.c
  14. +4 −0 bn_mp_addmod.c
  15. +4 −0 bn_mp_and.c
  16. +4 −0 bn_mp_clamp.c
  17. +4 −0 bn_mp_clear.c
  18. +4 −0 bn_mp_clear_multi.c
  19. +4 −0 bn_mp_cmp.c
  20. +4 −0 bn_mp_cmp_d.c
  21. +4 −0 bn_mp_cmp_mag.c
  22. +4 −0 bn_mp_cnt_lsb.c
  23. +4 −0 bn_mp_copy.c
  24. +4 −0 bn_mp_count_bits.c
  25. +4 −0 bn_mp_div.c
  26. +4 −0 bn_mp_div_2.c
  27. +4 −0 bn_mp_div_2d.c
  28. +4 −0 bn_mp_div_3.c
  29. +4 −0 bn_mp_div_d.c
  30. +4 −0 bn_mp_dr_is_modulus.c
  31. +4 −0 bn_mp_dr_reduce.c
  32. +4 −0 bn_mp_dr_setup.c
  33. +4 −0 bn_mp_exch.c
  34. +4 −0 bn_mp_expt_d.c
  35. +5 −1 bn_mp_exptmod.c
  36. +4 −0 bn_mp_exptmod_fast.c
  37. +4 −0 bn_mp_exteuclid.c
  38. +4 −0 bn_mp_fread.c
  39. +4 −0 bn_mp_fwrite.c
  40. +4 −0 bn_mp_gcd.c
  41. +4 −0 bn_mp_get_int.c
  42. +4 −0 bn_mp_grow.c
  43. +4 −0 bn_mp_init.c
  44. +4 −0 bn_mp_init_copy.c
  45. +4 −0 bn_mp_init_multi.c
  46. +4 −0 bn_mp_init_set.c
  47. +4 −0 bn_mp_init_set_int.c
  48. +4 −0 bn_mp_init_size.c
  49. +4 −0 bn_mp_invmod.c
  50. +4 −0 bn_mp_invmod_slow.c
  51. +4 −0 bn_mp_is_square.c
  52. +4 −0 bn_mp_jacobi.c
  53. +12 −8 bn_mp_karatsuba_mul.c
  54. +8 −4 bn_mp_karatsuba_sqr.c
  55. +4 −0 bn_mp_lcm.c
  56. +4 −0 bn_mp_lshd.c
  57. +4 −0 bn_mp_mod.c
  58. +4 −0 bn_mp_mod_2d.c
  59. +4 −0 bn_mp_mod_d.c
  60. +4 −0 bn_mp_montgomery_calc_normalization.c
  61. +4 −0 bn_mp_montgomery_reduce.c
  62. +4 −0 bn_mp_montgomery_setup.c
  63. +4 −0 bn_mp_mul.c
  64. +4 −0 bn_mp_mul_2.c
  65. +4 −0 bn_mp_mul_2d.c
  66. +4 −0 bn_mp_mul_d.c
  67. +5 −2 bn_mp_mulmod.c
  68. +4 −0 bn_mp_n_root.c
  69. +4 −0 bn_mp_neg.c
  70. +4 −0 bn_mp_or.c
  71. +4 −0 bn_mp_prime_fermat.c
  72. +4 −0 bn_mp_prime_is_divisible.c
  73. +4 −0 bn_mp_prime_is_prime.c
  74. +4 −0 bn_mp_prime_miller_rabin.c
  75. +4 −0 bn_mp_prime_next_prime.c
  76. +4 −0 bn_mp_prime_rabin_miller_trials.c
  77. +6 −4 bn_mp_prime_random_ex.c
  78. +4 −0 bn_mp_radix_size.c
  79. +4 −0 bn_mp_radix_smap.c
  80. +4 −0 bn_mp_rand.c
  81. +4 −0 bn_mp_read_radix.c
  82. +5 −2 bn_mp_read_signed_bin.c
  83. +5 −2 bn_mp_read_unsigned_bin.c
  84. +4 −0 bn_mp_reduce.c
  85. +4 −0 bn_mp_reduce_2k.c
  86. +4 −0 bn_mp_reduce_2k_l.c
  87. +4 −0 bn_mp_reduce_2k_setup.c
  88. +4 −0 bn_mp_reduce_2k_setup_l.c
  89. +4 −0 bn_mp_reduce_is_2k.c
  90. +4 −0 bn_mp_reduce_is_2k_l.c
  91. +4 −0 bn_mp_reduce_setup.c
  92. +4 −0 bn_mp_rshd.c
  93. +4 −0 bn_mp_set.c
  94. +4 −0 bn_mp_set_int.c
  95. +4 −0 bn_mp_shrink.c
  96. +4 −0 bn_mp_signed_bin_size.c
  97. +4 −0 bn_mp_sqr.c
  98. +4 −0 bn_mp_sqrmod.c
  99. +4 −0 bn_mp_sqrt.c
  100. +4 −0 bn_mp_sub.c
  101. +4 −0 bn_mp_sub_d.c
  102. +4 −0 bn_mp_submod.c
  103. +4 −0 bn_mp_to_signed_bin.c
  104. +4 −0 bn_mp_to_signed_bin_n.c
  105. +4 −0 bn_mp_to_unsigned_bin.c
  106. +4 −0 bn_mp_to_unsigned_bin_n.c
  107. +4 −0 bn_mp_toom_mul.c
  108. +4 −0 bn_mp_toom_sqr.c
  109. +4 −0 bn_mp_toradix.c
  110. +4 −0 bn_mp_toradix_n.c
  111. +4 −0 bn_mp_unsigned_bin_size.c
  112. +4 −0 bn_mp_xor.c
  113. +4 −0 bn_mp_zero.c
  114. +4 −0 bn_prime_tab.c
  115. +4 −0 bn_reverse.c
  116. +4 −0 bn_s_mp_add.c
  117. +4 −1 bn_s_mp_exptmod.c
  118. +4 −0 bn_s_mp_mul_digs.c
  119. +4 −0 bn_s_mp_mul_high_digs.c
  120. +4 −0 bn_s_mp_sqr.c
  121. +4 −0 bn_s_mp_sub.c
  122. +7 −3 bncore.c
  123. +3 −0 booker.pl
  124. +12 −0 changes.txt
  125. +6 −2 demo/demo.c
  126. +4 −0 demo/timing.c
  127. +4 −0 etc/2kprime.c
  128. +4 −0 etc/drprime.c
  129. +1 −1 etc/makefile.icc
  130. +4 −0 etc/mersenne.c
  131. +4 −0 etc/mont.c
  132. +4 −0 etc/pprime.c
  133. +4 −0 etc/tune.c
  134. +7 −7 logs/expt.log
  135. +5 −5 logs/expt_2k.log
  136. +4 −4 logs/expt_2kl.log
  137. +7 −7 logs/expt_dr.log
  138. +4 −1 logs/index.html
  139. +0 −17 logs/sqr.old
  140. +36 −15 makefile
  141. +4 −0 makefile.cygwin_dll
  142. +1 −1 makefile.icc
  143. +3 −1 makefile.msvc
  144. +33 −14 makefile.shared
  145. +4 −0 mess.sh
  146. +4 −0 mtest/logtab.h
  147. +4 −0 mtest/mpi-config.h
  148. +4 −0 mtest/mpi-types.h
  149. +4 −0 mtest/mpi.c
  150. +4 −0 mtest/mpi.h
  151. +4 −0 mtest/mtest.c
  152. BIN poster.pdf
  153. +498 −27 pre_gen/mpi.c
  154. +16 −10 tommath.h
  155. BIN tommath.pdf
  156. +15 −16 tommath.src
  157. +368 −302 tommath.tex
  158. +5 −0 tommath_class.h
  159. +5 −1 tommath_superclass.h
View
@@ -1,16 +0,0 @@
-things for book in order of importance...
-
-- Fix up pseudo-code [only] for combas that are not consistent with source
-- Start in chapter 3 [basics] and work up...
- - re-write to prose [less abrupt]
- - clean up pseudo code [spacing]
- - more examples where appropriate and figures
-
-Goal:
- - Get sync done by mid January [roughly 8-12 hours work]
- - Finish ch3-6 by end of January [roughly 12-16 hours of work]
- - Finish ch7-end by mid Feb [roughly 20-24 hours of work].
-
-Goal isn't "first edition" but merely cleaner to read.
-
-
View
Binary file not shown.
View
@@ -49,7 +49,7 @@
\begin{document}
\frontmatter
\pagestyle{empty}
-\title{LibTomMath User Manual \\ v0.35}
+\title{LibTomMath User Manual \\ v0.36}
\author{Tom St Denis \\ tomstdenis@iahu.ca}
\maketitle
This text, the library and the accompanying textbook are all hereby placed in the public domain. This book has been
View
@@ -41,3 +41,7 @@ char *mp_error_to_string(int code)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -142,3 +142,7 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL);
return res;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
@@ -166,3 +166,7 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
@@ -70,6 +70,7 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
/* execute loop */
for (iz = 0; iz < iy; ++iz) {
_W += ((mp_word)*tmpx++)*((mp_word)*tmpy--);
+
}
/* store term */
@@ -103,3 +104,7 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
@@ -95,3 +95,7 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -108,3 +108,7 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -42,3 +42,7 @@ mp_2expt (mp_int * a, int b)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -37,3 +37,7 @@ mp_abs (mp_int * a, mp_int * b)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -47,3 +47,7 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -103,3 +103,7 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -35,3 +35,7 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
return res;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -51,3 +51,7 @@ mp_and (mp_int * a, mp_int * b, mp_int * c)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -38,3 +38,7 @@ mp_clamp (mp_int * a)
}
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -38,3 +38,7 @@ mp_clear (mp_int * a)
}
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -28,3 +28,7 @@ void mp_clear_multi(mp_int *mp, ...)
va_end(args);
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -37,3 +37,7 @@ mp_cmp (mp_int * a, mp_int * b)
}
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -38,3 +38,7 @@ int mp_cmp_d(mp_int * a, mp_digit b)
}
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -49,3 +49,7 @@ int mp_cmp_mag (mp_int * a, mp_int * b)
return MP_EQ;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -47,3 +47,7 @@ int mp_cnt_lsb(mp_int *a)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -62,3 +62,7 @@ mp_copy (mp_int * a, mp_int * b)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -39,3 +39,7 @@ mp_count_bits (mp_int * a)
return r;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -286,3 +286,7 @@ LBL_Q:mp_clear (&q);
#endif
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -62,3 +62,7 @@ int mp_div_2(mp_int * a, mp_int * b)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -91,3 +91,7 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -73,3 +73,7 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -104,3 +104,7 @@ int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
@@ -37,3 +37,7 @@ int mp_dr_is_modulus(mp_int *a)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -88,3 +88,7 @@ mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -26,3 +26,7 @@ void mp_dr_setup(mp_int *a, mp_digit *d)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -28,3 +28,7 @@ mp_exch (mp_int * a, mp_int * b)
*b = t;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -51,3 +51,7 @@ int mp_expt_d (mp_int * a, mp_digit b, mp_int * c)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -66,7 +66,7 @@ int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y)
}
/* modified diminished radix reduction */
-#if defined(BN_MP_REDUCE_IS_2K_L_C) && defined(BN_MP_REDUCE_2K_L_C)
+#if defined(BN_MP_REDUCE_IS_2K_L_C) && defined(BN_MP_REDUCE_2K_L_C) && defined(BN_S_MP_EXPTMOD_C)
if (mp_reduce_is_2k_l(P) == MP_YES) {
return s_mp_exptmod(G, X, P, Y, 1);
}
@@ -106,3 +106,7 @@ int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
@@ -315,3 +315,7 @@ LBL_RES:mp_clear (&res);
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -76,3 +76,7 @@ _ERR: mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL
return err;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -61,3 +61,7 @@ int mp_fread(mp_int *a, int radix, FILE *stream)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -46,3 +46,7 @@ int mp_fwrite(mp_int *a, int radix, FILE *stream)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -107,3 +107,7 @@ LBL_U:mp_clear (&v);
return res;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -39,3 +39,7 @@ unsigned long mp_get_int(mp_int * a)
return res & 0xFFFFFFFFUL;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -51,3 +51,7 @@ int mp_grow (mp_int * a, int size)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -40,3 +40,7 @@ int mp_init (mp_int * a)
return MP_OKAY;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -26,3 +26,7 @@ int mp_init_copy (mp_int * a, mp_int * b)
return mp_copy (b, a);
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -53,3 +53,7 @@ int mp_init_multi(mp_int *mp, ...)
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
View
@@ -26,3 +26,7 @@ int mp_init_set (mp_int * a, mp_digit b)
return err;
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
@@ -25,3 +25,7 @@ int mp_init_set_int (mp_int * a, unsigned long b)
return mp_set_int(a, b);
}
#endif
+
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
Oops, something went wrong.

0 comments on commit 9294e79

Please sign in to comment.