Lines Matching refs:bnN

156     BIGNUM                          *bnN;  in EccCurveInit()  local
170 bnN = BN_CTX_get(context); in EccCurveInit()
180 BnFrom2B(bnN, curveData->n); in EccCurveInit()
187 && EC_GROUP_set_generator(group, P, bnN, bnH) in EccCurveInit()
800 BIGNUM *bnN; in SignEcdsa() local
815 bnN = BN_CTX_get(context); in SignEcdsa()
825 || BN_bin2bn(curveData->n->buffer, curveData->n->size, bnN) == NULL) in SignEcdsa()
862 BN_mod(bnR, bnR, bnN, context); in SignEcdsa()
871 if( BN_mod_inverse(bnIk, bnK, bnN, context) != NULL) in SignEcdsa()
907 if( !BN_mod_mul(bnD, bnR, bnD, bnN, context) in SignEcdsa()
911 || !BN_mod_mul(bnD, bnIk, bnD, bnN, context) in SignEcdsa()
955 BIGNUM *bnN, *bnK, *bnT, *bnD; in EcDaa() local
979 bnN = BN_CTX_get(context); in EcDaa()
987 if( BN_bin2bn(n->buffer, n->size, bnN) == NULL in EcDaa()
993 OK = OK && BN_mod(bnT, bnT, bnN, context); in EcDaa()
996 OK = OK && BN_mod_mul(bnD, bnT, bnD, bnN, context) == 1; in EcDaa()
998 OK = OK && BN_mod_add(bnD, bnK, bnD, bnN, context) == 1; in EcDaa()
1070 BIGNUM *bnR, *bnN, *bnK, *bnT, *bnD; in SchnorrEcc() local
1102 bnN = BN_CTX_get(context); in SchnorrEcc()
1113 if(BN_bin2bn(curveData->n->buffer, curveData->n->size, bnN) == NULL) in SchnorrEcc()
1136 BN_mod(bnR, bnR, bnN, context); in SchnorrEcc()
1150 BN_div(NULL, bnT, bnT, bnN, context); in SchnorrEcc()
1242 BIGNUM *bnN; in SignSM2() local
1259 bnN = BN_CTX_get(context); in SignSM2()
1266 BnFrom2B(bnN, curveData->n); in SignSM2()
1286 if( BN_ucmp(bnK, bnN) >= 0 in SignSM2()
1297 if(!BN_mod_add(bnR, bnE, bnX1, bnN, context)) in SignSM2()
1307 if(BN_is_zero(bnR) || BN_ucmp(bnT, bnN) == 0) in SignSM2()
1313 || !BN_mod_inverse(bnT, bnT, bnN, context) // (1 + dA)^-1 mod n in SignSM2()
1322 if( !BN_mod_mul(bnS, bnD, bnR, bnN, context) // (r * dA) mod n in SignSM2()
1323 || !BN_mod_sub(bnS, bnK, bnS, bnN, context) // (k - (r * dA) mod n in SignSM2()
1324 || !BN_mod_mul(bnS, bnT, bnS, bnN, context))// t * (k - (r * dA) mod n in SignSM2()
1437 BIGNUM *bnN; in ValidateSignatureEcdsa() local
1460 bnN = BN_CTX_get(context); in ValidateSignatureEcdsa()
1488 || BN_bin2bn(curveData->n->buffer, curveData->n->size, bnN) == NULL) in ValidateSignatureEcdsa()
1497 if (BN_mod_inverse(bnW, bnS, bnN, context) == NULL) in ValidateSignatureEcdsa()
1500 if( !BN_mod_mul(bnU1, bnE, bnW, bnN, context) in ValidateSignatureEcdsa()
1501 || !BN_mod_mul(bnU2, bnR, bnW, bnN, context)) in ValidateSignatureEcdsa()
1512 || !BN_mod(bnV, bnV, bnN, context)) in ValidateSignatureEcdsa()
1786 BIGNUM *bnN // IN: the order of the curve in avf1() argument
1790 int f = (BN_num_bits(bnN) + 1) / 2; in avf1()
1834 BIGNUM *bnN; in C_2_2_MQV() local
1849 bnN = BN_CTX_get(context); in C_2_2_MQV()
1866 BnFrom2B(bnN, curveData->n); in C_2_2_MQV()
1881 avf1(bnTa, bnN); in C_2_2_MQV()
1883 !BN_mod_mul(bnTa, bnDsA, bnTa, bnN, context) in C_2_2_MQV()
1885 || !BN_mod_add(bnTa, bnDeA, bnTa, bnN, context) in C_2_2_MQV()
1900 avf1(bnXeB, bnN); in C_2_2_MQV()
1910 Point2B(group, outZ, pQeB, (INT16)BN_num_bytes(bnN), context); in C_2_2_MQV()
1935 BIGNUM *bnN // IN: the order of the curve in avfSm2() argument
1939 int w = ((BN_num_bits(bnN) + 1) / 2) - 1; in avfSm2()
1979 BIGNUM *bnN; in SM2KeyExchange() local
1995 bnN = BN_CTX_get(context); in SM2KeyExchange()
2007 BnFrom2B(bnN, curveData->n); in SM2KeyExchange()
2021 avfSm2(bnTa, bnN); in SM2KeyExchange()
2023 !BN_mod_mul(bnTa, bnDeA, bnTa, bnN, context) in SM2KeyExchange()
2025 || !BN_mod_add(bnTa, bnDsA, bnTa, bnN, context) in SM2KeyExchange()
2040 avfSm2(bnXeB, bnN); in SM2KeyExchange()
2050 Point2B(group, outZ, pQeB, (INT16)BN_num_bytes(bnN), context); in SM2KeyExchange()