/openssl/crypto/ec/ |
H A D | ec_lib.c | 73 BN_free(ret->cofactor); in ossl_ec_group_new_ex() 133 BN_free(group->cofactor); in EC_GROUP_free() 239 if (!BN_copy(dest->cofactor, src->cofactor)) in EC_GROUP_copy() 350 || !BN_add(group->cofactor, group->cofactor, q) /* q + n/2 */ in ec_guess_cofactor() 352 || !BN_add(group->cofactor, group->cofactor, BN_value_one()) in ec_guess_cofactor() 354 || !BN_div(group->cofactor, NULL, group->cofactor, group->order, ctx)) in ec_guess_cofactor() 394 if (cofactor != NULL && BN_is_negative(cofactor)) { in EC_GROUP_set_generator() 411 if (cofactor != NULL && !BN_is_zero(cofactor)) { in EC_GROUP_set_generator() 412 if (!BN_copy(group->cofactor, cofactor)) in EC_GROUP_set_generator() 469 if (!BN_copy(cofactor, group->cofactor)) in EC_GROUP_get_cofactor() [all …]
|
H A D | eck_prn.c | 77 const BIGNUM *order = NULL, *cofactor = NULL; in ECPKParameters_print() local 144 cofactor = EC_GROUP_get0_cofactor(x); in ECPKParameters_print() 207 if ((cofactor != NULL) && !ASN1_bn_print(bp, "Cofactor: ", cofactor, in ECPKParameters_print()
|
H A D | ec_curve.c | 29 unsigned int cofactor; /* promoted to BN_ULONG */ member 3212 || !BN_set_word(x, (BN_ULONG)data->cofactor)) { in ec_group_new_from_data() 3351 const BIGNUM *cofactor = NULL; in ossl_ec_curve_nid_from_params() local 3360 cofactor = EC_GROUP_get0_cofactor(group); in ossl_ec_curve_nid_from_params() 3421 && (BN_is_zero(cofactor) in ossl_ec_curve_nid_from_params() 3422 || BN_is_word(cofactor, (const BN_ULONG)curve.data->cofactor)) in ossl_ec_curve_nid_from_params()
|
H A D | ec_backend.c | 259 const BIGNUM *cofactor = EC_GROUP_get0_cofactor(group); in ec_group_explicit_todata() local 261 if (cofactor != NULL in ec_group_explicit_todata() 263 OSSL_PKEY_PARAM_EC_COFACTOR, cofactor)) { in ec_group_explicit_todata() 362 const BIGNUM *cofactor; in ossl_ec_set_ecdh_cofactor_mode() local 373 if ((cofactor = EC_GROUP_get0_cofactor(ecg)) == NULL ) in ossl_ec_set_ecdh_cofactor_mode() 377 if (BN_is_one(cofactor)) in ossl_ec_set_ecdh_cofactor_mode()
|
H A D | ec_asn1.c | 75 ASN1_INTEGER *cofactor; member 152 ASN1_OPT(ECPARAMETERS, cofactor, ASN1_INTEGER) 453 ret->cofactor = BN_to_ASN1_INTEGER(tmp, orig = ret->cofactor); in EC_GROUP_get_ecparameters() 454 if (ret->cofactor == NULL) { in EC_GROUP_get_ecparameters() 455 ret->cofactor = orig; in EC_GROUP_get_ecparameters() 747 if (params->cofactor == NULL) { in EC_GROUP_new_from_ecparameters() 750 } else if (ASN1_INTEGER_to_BN(params->cofactor, b) == NULL) { in EC_GROUP_new_from_ecparameters()
|
H A D | ec_mult.c | 165 if (BN_is_zero(group->cofactor)) { in ossl_ec_scalar_mul_ladder() 202 if (!BN_mul(cardinality, group->order, group->cofactor, ctx)) { in ossl_ec_scalar_mul_ladder() 438 if (!BN_is_zero(group->order) && !BN_is_zero(group->cofactor)) { in ossl_ec_wNAF_mul()
|
H A D | ec_pmeth.c | 300 if (BN_is_one(ec_key->group->cofactor)) in pkey_ec_ctrl()
|
H A D | ec_local.h | 213 BIGNUM *order, *cofactor; member
|
H A D | ec2_smpl.c | 891 if (num > 1 || BN_is_zero(group->order) || BN_is_zero(group->cofactor)) in ec_GF2m_simple_points_mul()
|
/openssl/doc/man7/ |
H A D | EVP_PKEY-EC.pod | 61 =item "cofactor" (B<OSSL_PKEY_PARAM_EC_COFACTOR>) <unsigned integer> 68 I<cofactor> is an optional value. 69 I<order> multiplied by the I<cofactor> gives the number of points on the curve. 76 =item "use-cofactor-flag" (B<OSSL_PKEY_PARAM_USE_COFACTOR_ECDH>) <integer> 79 if the value is zero. The cofactor variant multiplies the shared secret by the 80 EC curve's cofactor (note for some curves the cofactor is 1). 239 * This curve has a cofactor that is not 1 - so setting CDH mode changes 240 * the behaviour. For many curves the cofactor is 1 - so setting this has
|
H A D | EVP_KEYEXCH-ECDH.pod | 15 =item "ecdh-cofactor-mode" (B<OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE>) <integer> 23 When setting, the value should be 1, 0 or -1, respectively forcing cofactor mode 28 cofactor mode is on or off.
|
H A D | EVP_PKEY-SM2.pod | 25 =item "cofactor" (B<OSSL_PKEY_PARAM_EC_COFACTOR>) <unsigned integer>
|
H A D | EVP_PKEY-FFC.pod | 97 satisfies g = h^j mod p (where g != 1 and "j" is the cofactor). 101 An optional informational cofactor parameter that should equal to (p - 1) / q.
|
/openssl/crypto/cms/ |
H A D | cms_ec.c | 126 int kdf_nid, kdfmd_nid, cofactor; in ecdh_cms_set_kdf_param() local 137 cofactor = 0; in ecdh_cms_set_kdf_param() 139 cofactor = 1; in ecdh_cms_set_kdf_param() 143 if (EVP_PKEY_CTX_set_ecdh_cofactor_mode(pctx, cofactor) <= 0) in ecdh_cms_set_kdf_param()
|
/openssl/doc/man3/ |
H A D | EC_GROUP_copy.pod | 27 const BIGNUM *order, const BIGNUM *cofactor); 33 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx); 84 parameters include the B<generator>, the B<order> and the B<cofactor>. The B<generator> is a well d… 86 n-1 where n is the B<order>. The B<order> multiplied by the B<cofactor> gives the number of points … 94 EC_GROUP_get_cofactor() retrieves the cofactor of B<group> and copies its value 95 into B<cofactor>. It fails in case B<group> is not fully initialized or if the 96 cofactor is not set (or set to zero). 208 …UP_get_cofactor() returns 0 if the cofactor is not set (or is set to zero) for B<group> or if copy… 226 EC_GROUP_get0_cofactor() returns an internal pointer to the group cofactor.
|
H A D | EVP_PKEY_CTX_ctrl.pod | 580 EVP_PKEY_CTX_set_ecdh_cofactor_mode() sets the cofactor mode to I<cofactor_mode> 581 for ECDH key derivation. Possible values are 1 to enable cofactor 582 key derivation, 0 to disable it and -1 to clear the stored cofactor mode and 583 fallback to the private key cofactor mode. 585 EVP_PKEY_CTX_get_ecdh_cofactor_mode() returns the cofactor mode for I<ctx> used 586 for ECDH key derivation. Possible values are 1 when cofactor key derivation is
|
/openssl/providers/implementations/exchange/ |
H A D | ecdh_exch.c | 439 const BIGNUM *cofactor; in ecdh_plain_derive() local 454 || (cofactor = EC_GROUP_get0_cofactor(group)) == NULL) in ecdh_plain_derive() 479 && !BN_is_one(cofactor)) { in ecdh_plain_derive()
|
/openssl/providers/implementations/encode_decode/ |
H A D | encode_key2text.c | 433 const BIGNUM *order = NULL, *cofactor = NULL; in ec_param_explicit_to_text() local 450 cofactor = EC_GROUP_get0_cofactor(group); in ec_param_explicit_to_text() 457 || (cofactor != NULL in ec_param_explicit_to_text() 458 && !print_labeled_bignum(out, "Cofactor: ", cofactor)) in ec_param_explicit_to_text()
|
/openssl/providers/implementations/keymgmt/ |
H A D | ec_kmgmt.c | 978 BIGNUM *p, *a, *b, *order, *cofactor; member 1111 COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_COFACTOR, gctx->cofactor); in ec_gen_set_params() 1168 if (gctx->cofactor != NULL in ec_gen_set_group_from_params() 1170 gctx->cofactor)) in ec_gen_set_group_from_params() 1349 BN_free(gctx->cofactor); in ec_gen_cleanup()
|
/openssl/test/ |
H A D | endecode_test.c | 1154 BIGNUM *a, *b, *poly, *order, *cofactor; in do_create_ec_explicit_trinomial_params() local 1183 && TEST_ptr(cofactor = BN_CTX_get(bnctx)) in do_create_ec_explicit_trinomial_params() 1188 && TEST_ptr(BN_bin2bn(cofactor_data, sizeof(cofactor_data), cofactor)) in do_create_ec_explicit_trinomial_params() 1200 cofactor)); in do_create_ec_explicit_trinomial_params()
|
/openssl/include/openssl/ |
H A D | ec.h | 222 const BIGNUM *order, const BIGNUM *cofactor); 262 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
|
/openssl/doc/internal/man7/ |
H A D | EVP_PKEY.pod | 87 It's possible to flip the ECDH cofactor mode.
|
/openssl/crypto/err/ |
H A D | openssl.txt | 568 EC_R_INVALID_COFACTOR:171:invalid cofactor 615 EC_R_UNKNOWN_COFACTOR:164:unknown cofactor
|
/openssl/crypto/objects/ |
H A D | objects.txt | 1667 : dh-cofactor-kdf
|
/openssl/ |
H A D | CHANGES.md | 1477 this change, EC_GROUP_set_generator would accept order and/or cofactor as 1478 NULL. After this change, only the cofactor parameter can be NULL. It also 2227 this change, EC_GROUP_set_generator would accept order and/or cofactor as 2228 NULL. After this change, only the cofactor parameter can be NULL. It also 2997 this change, EC_GROUP_set_generator would accept order and/or cofactor as 2998 NULL. After this change, only the cofactor parameter can be NULL. It also 4794 this change, EC_GROUP_set_generator would accept order and/or cofactor as 4795 NULL. After this change, only the cofactor parameter can be NULL. It also
|