Lines Matching refs:bnN
39 BIGNUM *bnN; in RsaPrivateExponent() local
54 bnN = BN_CTX_get(context); in RsaPrivateExponent()
63 if( BN_bin2bn(key->publicKey->buffer, key->publicKey->size, bnN) == NULL in RsaPrivateExponent()
70 if(BN_num_bits(bnP) < BN_num_bits(bnN)/2) in RsaPrivateExponent()
76 if (BN_div(bnQ, bnQr, bnN, bnP, context) != 1) in RsaPrivateExponent()
85 if( BN_copy(bnPhi, bnN) == NULL in RsaPrivateExponent()
144 BIGNUM *bnN; in _cpri__TestKeyRSA() local
165 bnN = BN_CTX_get(context); // public modulus (n) in _cpri__TestKeyRSA()
187 if(BN_mul(bnN, bnP, bnQ, context) != 1) in _cpri__TestKeyRSA()
191 if(BN_num_bits(bnN) != (publicKey->size * 8)) in _cpri__TestKeyRSA()
196 BN_bn2bin(bnN, publicKey->buffer); in _cpri__TestKeyRSA()
201 BN_bin2bn(publicKey->buffer, publicKey->size, bnN); in _cpri__TestKeyRSA()
203 if(BN_div(bnQ, bnQr, bnN, bnP, context) != 1) in _cpri__TestKeyRSA()
213 BN_copy(bnPhi, bnN); in _cpri__TestKeyRSA()
1186 BIGNUM *bnN; in _cpri__GenerateKeyRSA() local
1210 bnN = BN_CTX_get(context); in _cpri__GenerateKeyRSA()
1211 if(bnN == NULL) in _cpri__GenerateKeyRSA()
1318 BN_mul(bnN, bnP, bnQ, context); in _cpri__GenerateKeyRSA()
1319 if(BN_num_bits(bnN) != keySizeInBits) in _cpri__GenerateKeyRSA()
1322 BnTo2B(n, bnN, n->size); // Will pad the buffer to the correct size in _cpri__GenerateKeyRSA()
1331 BN_sub(bnT, bnN, bnP); in _cpri__GenerateKeyRSA()
1365 || BN_mod_exp(bnQ, bnP, bnE, bnN, context) != 1 in _cpri__GenerateKeyRSA()
1367 || BN_mod_exp(bnQ, bnQ, bnT, bnN, context) != 1) in _cpri__GenerateKeyRSA()