| 1 | /* TomsFastMath, a fast ISO C bignum library. |
| 2 | * |
| 3 | * This project is public domain and free for all purposes. |
| 4 | * |
| 5 | * Love Hornquist Astrand <[email protected]> |
| 6 | */ |
| 7 | #include <tommath.h>cxx . . $ `<file>/lib/hcrypto/libtommath/tommath.h`/ |
| 8 | #ifdef BN_MP_FIND_PRIME_Ccxx . . $ `lib/hcrypto/libtommath/tommath_class.h:45:9`! |
| 9 | int mp_find_primecxx . . $ mp_find_prime(7361bc60091cb21a).(mp_intcxx . . $ mp_int# *a, int t) |
| 10 | { |
| 11 | int res = MP_NOcxx . . $ `lib/hcrypto/libtommath/tommath.h:148:9`!; |
| 12 | |
| 13 | /* valid value of t? */ |
| 14 | if (t <= 0 || t > PRIME_SIZEcxx . . $ `lib/hcrypto/libtommath/tommath.h:456:12`!) { |
| 15 | return MP_VALcxx . . $ `lib/hcrypto/libtommath/tommath.h:144:9`!; |
| 16 | } |
| 17 | |
| 18 | if (mp_isevencxx . . $ `lib/hcrypto/libtommath/tommath.h:222:9`!(a)) |
| 19 | mp_add_dcxx . . $ mp_add_d(efd2ad07c4b12143).(a, 1, a); |
| 20 | |
| 21 | do { |
| 22 | if (mp_prime_is_primecxx . . $ mp_prime_is_prime(ffabdbcfd6180c68).(a, t, &res) != 0) { |
| 23 | res = MP_VALcxx . . $ `lib/hcrypto/libtommath/tommath.h:144:9`!; |
| 24 | break; |
| 25 | } |
| 26 | |
| 27 | if (res == MP_NOcxx . . $ `lib/hcrypto/libtommath/tommath.h:148:9`!) { |
| 28 | mp_add_dcxx . . $ mp_add_d(efd2ad07c4b12143).(a, 2, a); |
| 29 | continue; |
| 30 | } |
| 31 | |
| 32 | } while (res != MP_YEScxx . . $ `lib/hcrypto/libtommath/tommath.h:147:9`!); |
| 33 | |
| 34 | return res; |
| 35 | } |
| 36 | #endif |