summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn.h')
-rw-r--r--src/lib/libcrypto/bn/bn.h34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h
index 1251521c54..3da6d8ced9 100644
--- a/src/lib/libcrypto/bn/bn.h
+++ b/src/lib/libcrypto/bn/bn.h
@@ -225,23 +225,10 @@ extern "C" {
225 225
226#define BN_FLG_MALLOCED 0x01 226#define BN_FLG_MALLOCED 0x01
227#define BN_FLG_STATIC_DATA 0x02 227#define BN_FLG_STATIC_DATA 0x02
228#define BN_FLG_EXP_CONSTTIME 0x04 /* avoid leaking exponent information through timings
229 * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */
230#define BN_FLG_FREE 0x8000 /* used for debuging */ 228#define BN_FLG_FREE 0x8000 /* used for debuging */
231#define BN_set_flags(b,n) ((b)->flags|=(n)) 229#define BN_set_flags(b,n) ((b)->flags|=(n))
232#define BN_get_flags(b,n) ((b)->flags&(n)) 230#define BN_get_flags(b,n) ((b)->flags&(n))
233 231
234/* get a clone of a BIGNUM with changed flags, for *temporary* use only
235 * (the two BIGNUMs cannot not be used in parallel!) */
236#define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \
237 (dest)->top=(b)->top, \
238 (dest)->dmax=(b)->dmax, \
239 (dest)->neg=(b)->neg, \
240 (dest)->flags=(((dest)->flags & BN_FLG_MALLOCED) \
241 | ((b)->flags & ~BN_FLG_MALLOCED) \
242 | BN_FLG_STATIC_DATA \
243 | (n)))
244
245typedef struct bignum_st 232typedef struct bignum_st
246 { 233 {
247 BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */ 234 BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */
@@ -391,8 +378,6 @@ int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
391 const BIGNUM *m,BN_CTX *ctx); 378 const BIGNUM *m,BN_CTX *ctx);
392int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 379int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
393 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); 380 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
394int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
395 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont);
396int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, 381int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
397 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); 382 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
398int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, 383int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
@@ -438,19 +423,6 @@ int BN_is_prime_fasttest(const BIGNUM *p,int nchecks,
438 void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg, 423 void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg,
439 int do_trial_division); 424 int do_trial_division);
440 425
441#ifdef OPENSSL_FIPS
442int BN_X931_derive_prime(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
443 void (*cb)(int, int, void *), void *cb_arg,
444 const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2,
445 const BIGNUM *e, BN_CTX *ctx);
446int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
447int BN_X931_generate_prime(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
448 BIGNUM *Xp1, BIGNUM *Xp2,
449 const BIGNUM *Xp,
450 const BIGNUM *e, BN_CTX *ctx,
451 void (*cb)(int, int, void *), void *cb_arg);
452#endif
453
454BN_MONT_CTX *BN_MONT_CTX_new(void ); 426BN_MONT_CTX *BN_MONT_CTX_new(void );
455void BN_MONT_CTX_init(BN_MONT_CTX *ctx); 427void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
456int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b, 428int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,
@@ -462,8 +434,6 @@ int BN_from_montgomery(BIGNUM *r,const BIGNUM *a,
462void BN_MONT_CTX_free(BN_MONT_CTX *mont); 434void BN_MONT_CTX_free(BN_MONT_CTX *mont);
463int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); 435int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx);
464BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from); 436BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from);
465BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
466 const BIGNUM *mod, BN_CTX *ctx);
467 437
468BN_BLINDING *BN_BLINDING_new(BIGNUM *A,BIGNUM *Ai,BIGNUM *mod); 438BN_BLINDING *BN_BLINDING_new(BIGNUM *A,BIGNUM *Ai,BIGNUM *mod);
469void BN_BLINDING_free(BN_BLINDING *b); 439void BN_BLINDING_free(BN_BLINDING *b);
@@ -540,15 +510,11 @@ void ERR_load_BN_strings(void);
540#define BN_F_BN_CTX_GET 116 510#define BN_F_BN_CTX_GET 116
541#define BN_F_BN_CTX_NEW 106 511#define BN_F_BN_CTX_NEW 106
542#define BN_F_BN_DIV 107 512#define BN_F_BN_DIV 107
543#define BN_F_BN_EXP 123
544#define BN_F_BN_EXPAND2 108 513#define BN_F_BN_EXPAND2 108
545#define BN_F_BN_EXPAND_INTERNAL 120 514#define BN_F_BN_EXPAND_INTERNAL 120
546#define BN_F_BN_MOD_EXP2_MONT 118 515#define BN_F_BN_MOD_EXP2_MONT 118
547#define BN_F_BN_MOD_EXP_MONT 109 516#define BN_F_BN_MOD_EXP_MONT 109
548#define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124
549#define BN_F_BN_MOD_EXP_MONT_WORD 117 517#define BN_F_BN_MOD_EXP_MONT_WORD 117
550#define BN_F_BN_MOD_EXP_RECP 125
551#define BN_F_BN_MOD_EXP_SIMPLE 126
552#define BN_F_BN_MOD_INVERSE 110 518#define BN_F_BN_MOD_INVERSE 110
553#define BN_F_BN_MOD_LSHIFT_QUICK 119 519#define BN_F_BN_MOD_LSHIFT_QUICK 119
554#define BN_F_BN_MOD_MUL_RECIPROCAL 111 520#define BN_F_BN_MOD_MUL_RECIPROCAL 111