diff options
Diffstat (limited to '3rd_party/libsrp6a-sha512/t_math.c')
| -rw-r--r-- | 3rd_party/libsrp6a-sha512/t_math.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/3rd_party/libsrp6a-sha512/t_math.c b/3rd_party/libsrp6a-sha512/t_math.c index 166ee4c..037650e 100644 --- a/3rd_party/libsrp6a-sha512/t_math.c +++ b/3rd_party/libsrp6a-sha512/t_math.c | |||
| @@ -39,11 +39,13 @@ typedef BIGNUM * BigInteger; | |||
| 39 | typedef BN_CTX * BigIntegerCtx; | 39 | typedef BN_CTX * BigIntegerCtx; |
| 40 | typedef BN_MONT_CTX * BigIntegerModAccel; | 40 | typedef BN_MONT_CTX * BigIntegerModAccel; |
| 41 | #include <limits.h> | 41 | #include <limits.h> |
| 42 | #if OPENSSL_VERSION_NUMBER < 0x30000000L | ||
| 42 | # ifndef OPENSSL_NO_ENGINE | 43 | # ifndef OPENSSL_NO_ENGINE |
| 43 | # define OPENSSL_ENGINE | 44 | # define OPENSSL_ENGINE |
| 44 | # include "openssl/engine.h" | 45 | # include "openssl/engine.h" |
| 45 | static ENGINE * default_engine = NULL; | 46 | static ENGINE * default_engine = NULL; |
| 46 | # endif /* OPENSSL_ENGINE */ | 47 | # endif /* OPENSSL_ENGINE */ |
| 48 | #endif | ||
| 47 | typedef int (*modexp_meth)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 49 | typedef int (*modexp_meth)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
| 48 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *mctx); | 50 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *mctx); |
| 49 | static modexp_meth default_modexp = NULL; | 51 | static modexp_meth default_modexp = NULL; |
| @@ -758,7 +760,11 @@ BigIntegerCheckPrime(BigInteger n, BigIntegerCtx c) | |||
| 758 | if(c == NULL) | 760 | if(c == NULL) |
| 759 | c = ctx = BN_CTX_new(); | 761 | c = ctx = BN_CTX_new(); |
| 760 | #if OPENSSL_VERSION_NUMBER >= 0x00908000 | 762 | #if OPENSSL_VERSION_NUMBER >= 0x00908000 |
| 761 | rv = BN_is_prime_ex(n, 25, c, NULL); | 763 | #if OPENSSL_VERSION_NUMBER >= 0x30000000L |
| 764 | rv = BN_check_prime(n, c, NULL); | ||
| 765 | #else | ||
| 766 | rv = BN_is_prime_ex(n, 25, c, NULL); | ||
| 767 | #endif | ||
| 762 | #else | 768 | #else |
| 763 | rv = BN_is_prime(n, 25, NULL, c, NULL); | 769 | rv = BN_is_prime(n, 25, NULL, c, NULL); |
| 764 | #endif | 770 | #endif |
