Changeset View
Changeset View
Standalone View
Standalone View
crypto/bn/bn_blind.c
Context not available. | |||||
#define BN_BLINDING_COUNTER 32 | #define BN_BLINDING_COUNTER 32 | ||||
struct bn_blinding_st { | |||||
BIGNUM *A; | |||||
BIGNUM *Ai; | |||||
BIGNUM *e; | |||||
BIGNUM *mod; /* just a reference */ | |||||
CRYPTO_THREAD_ID tid; | |||||
int counter; | |||||
unsigned long flags; | |||||
BN_MONT_CTX *m_ctx; | |||||
int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | |||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | |||||
CRYPTO_RWLOCK *lock; | |||||
}; | |||||
BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod) | BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod) | ||||
{ | { | ||||
BN_BLINDING *ret = NULL; | BN_BLINDING *ret = NULL; | ||||
Context not available. | |||||
n->top = (int)(rtop & ~mask) | (ntop & mask); | n->top = (int)(rtop & ~mask) | (ntop & mask); | ||||
n->flags |= (BN_FLG_FIXED_TOP & ~mask); | n->flags |= (BN_FLG_FIXED_TOP & ~mask); | ||||
} | } | ||||
ret = BN_mod_mul_montgomery(n, n, r, b->m_ctx, ctx); | ret = bn_mul_mont_fixed_top(n, n, r, b->m_ctx, ctx); | ||||
bn_correct_top_consttime(n); | |||||
} else { | } else { | ||||
ret = BN_mod_mul(n, n, r, b->mod, ctx); | ret = BN_mod_mul(n, n, r, b->mod, ctx); | ||||
} | } | ||||
Context not available. |