diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2018-07-05 09:28:51 +1000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-03-12 12:00:52 +0000 |
commit | 8240d5fa6535fb20e24fbe7eadbb3d6452a8d305 (patch) | |
tree | 3e785e20a83324c8dab559a5e3da6d533bb82f33 /crypto/include | |
parent | d1229190bfbb19439589557e4d65f9bccab09b2d (diff) |
FIPS 186-4 RSA Generation & Validation
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6652)
Diffstat (limited to 'crypto/include')
-rw-r--r-- | crypto/include/internal/bn_int.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/crypto/include/internal/bn_int.h b/crypto/include/internal/bn_int.h index 66e34ec5b8..514eaeeb90 100644 --- a/crypto/include/internal/bn_int.h +++ b/crypto/include/internal/bn_int.h @@ -87,4 +87,31 @@ int bn_rshift_fixed_top(BIGNUM *r, const BIGNUM *a, int n); int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); +#define BN_PRIMETEST_COMPOSITE 0 +#define BN_PRIMETEST_COMPOSITE_WITH_FACTOR 1 +#define BN_PRIMETEST_COMPOSITE_NOT_POWER_OF_PRIME 2 +#define BN_PRIMETEST_PROBABLY_PRIME 3 + +int bn_miller_rabin_is_prime(const BIGNUM *w, int iterations, BN_CTX *ctx, + BN_GENCB *cb, int enhanced, int *status); + +const BIGNUM *bn_get0_small_factors(void); + +int bn_rsa_fips186_4_prime_MR_min_checks(int nbits); + +int bn_rsa_fips186_4_gen_prob_primes(BIGNUM *p, BIGNUM *Xpout, + BIGNUM *p1, BIGNUM *p2, + const BIGNUM *Xp, const BIGNUM *Xp1, + const BIGNUM *Xp2, int nlen, + const BIGNUM *e, BN_CTX *ctx, + BN_GENCB *cb); + +int bn_rsa_fips186_4_derive_prime(BIGNUM *Y, BIGNUM *X, const BIGNUM *Xin, + const BIGNUM *r1, const BIGNUM *r2, int nlen, + const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb); + +#ifdef __cplusplus +} +#endif + #endif |