Lines Matching refs:bnQ
43 BIGNUM *bnQ;
57 bnQ = BN_CTX_get(context);
76 if (BN_div(bnQ, bnQr, bnN, bnP, context) != 1)
79 if(BN_num_bytes(bnQr) != 0 || BN_num_bits(bnQ) != BN_num_bits(bnP))
87 || !BN_sub(bnPhi, bnPhi, bnQ)
148 BIGNUM *bnQ;
168 bnQ = BN_CTX_get(context); // prime2 (q)
178 if(BN_bin2bn(prime2->buffer, prime2->size, bnQ) == NULL)
181 if(BN_num_bits(bnQ) != BN_num_bits(bnP))
187 if(BN_mul(bnN, bnP, bnQ, context) != 1)
208 if(BN_div(bnQ, bnQr, bnN, bnP, context) != 1)
211 if(BN_num_bytes(bnQr) != 0 || BN_num_bits(bnQ) != BN_num_bits(bnP))
220 BN_sub(bnPhi, bnPhi, bnQ);
1196 BIGNUM *bnQ;
1220 bnQ = BN_CTX_get(context);
1233 BN_zero(bnQ);
1297 if(!BN_is_zero(bnQ))
1299 // bnQ is non-zero if we already found it
1300 if(BN_ucmp(bnP, bnQ) < 0)
1301 BN_sub(bnT, bnQ, bnP);
1303 BN_sub(bnT, bnP, bnQ);
1324 if(BN_is_zero(bnQ))
1327 BN_copy(bnQ, bnP);
1331 BN_mul(bnN, bnP, bnQ, context);
1345 BN_sub(bnT, bnT, bnQ);
1378 || BN_mod_exp(bnQ, bnP, bnE, bnN, context) != 1
1380 || BN_mod_exp(bnQ, bnQ, bnT, bnN, context) != 1)
1383 if(BN_ucmp(bnP, bnQ) != 0)
1385 BN_zero(bnQ);