/openssl/crypto/ec/ |
H A D | ec_lib.c | 70 BN_free(ret->cofactor); in ossl_ec_group_new_ex() 134 BN_free(group->cofactor); in EC_GROUP_free() 244 if (!BN_copy(dest->cofactor, src->cofactor)) in EC_GROUP_copy() 353 || !BN_add(group->cofactor, group->cofactor, q) /* q + n/2 */ in ec_guess_cofactor() 355 || !BN_add(group->cofactor, group->cofactor, BN_value_one()) in ec_guess_cofactor() 357 || !BN_div(group->cofactor, NULL, group->cofactor, group->order, ctx)) in ec_guess_cofactor() 397 if (cofactor != NULL && BN_is_negative(cofactor)) { in EC_GROUP_set_generator() 414 if (cofactor != NULL && !BN_is_zero(cofactor)) { in EC_GROUP_set_generator() 415 if (!BN_copy(group->cofactor, cofactor)) in EC_GROUP_set_generator() 472 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 3245 || !BN_set_word(x, (BN_ULONG)data->cofactor)) { in ec_group_new_from_data() 3384 const BIGNUM *cofactor = NULL; in ossl_ec_curve_nid_from_params() local 3393 cofactor = EC_GROUP_get0_cofactor(group); in ossl_ec_curve_nid_from_params() 3454 && (BN_is_zero(cofactor) in ossl_ec_curve_nid_from_params() 3455 || 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) 451 ret->cofactor = BN_to_ASN1_INTEGER(tmp, orig = ret->cofactor); in EC_GROUP_get_ecparameters() 452 if (ret->cofactor == NULL) { in EC_GROUP_get_ecparameters() 453 ret->cofactor = orig; in EC_GROUP_get_ecparameters() 743 if (params->cofactor == NULL) { in EC_GROUP_new_from_ecparameters() 746 } else if (ASN1_INTEGER_to_BN(params->cofactor, b) == NULL) { in EC_GROUP_new_from_ecparameters()
|
H A D | ec_mult.c | 159 if (BN_is_zero(group->cofactor)) { in ossl_ec_scalar_mul_ladder() 196 if (!BN_mul(cardinality, group->order, group->cofactor, ctx)) { in ossl_ec_scalar_mul_ladder() 432 if (!BN_is_zero(group->order) && !BN_is_zero(group->cofactor)) { in ossl_ec_wNAF_mul()
|
H A D | ec_key.c | 566 const BIGNUM *cofactor = EC_GROUP_get0_cofactor(eckey->group); in ossl_ec_key_public_check() local 571 if (cofactor != NULL && BN_is_one(cofactor)) { in ossl_ec_key_public_check()
|
H A D | ec_pmeth.c | 296 if (BN_is_one(ec_key->group->cofactor)) in pkey_ec_ctrl()
|
H A D | ec_local.h | 215 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_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. 58 =item "ecdh-cofactor-check" (B<OSSL_EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK>) <integer> 62 the EC curve has a cofactor that is not 1, and the cofactor is not used.
|
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). 279 * This curve has a cofactor that is not 1 - so setting CDH mode changes 280 * the behaviour. For many curves the cofactor is 1 - so setting this has
|
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.
|
H A D | EVP_PKEY-SM2.pod | 25 =item "cofactor" (B<OSSL_PKEY_PARAM_EC_COFACTOR>) <unsigned integer>
|
/openssl/crypto/cms/ |
H A D | cms_ec.c | 127 int kdf_nid, kdfmd_nid, cofactor; in ecdh_cms_set_kdf_param() local 138 cofactor = 0; in ecdh_cms_set_kdf_param() 140 cofactor = 1; in ecdh_cms_set_kdf_param() 144 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 | 597 EVP_PKEY_CTX_set_ecdh_cofactor_mode() sets the cofactor mode to I<cofactor_mode> 598 for ECDH key derivation. Possible values are 1 to enable cofactor 599 key derivation, 0 to disable it and -1 to clear the stored cofactor mode and 600 fallback to the private key cofactor mode. 602 EVP_PKEY_CTX_get_ecdh_cofactor_mode() returns the cofactor mode for I<ctx> used 603 for ECDH key derivation. Possible values are 1 when cofactor key derivation is
|
/openssl/providers/implementations/encode_decode/ |
H A D | encode_key2text.c | 434 const BIGNUM *order = NULL, *cofactor = NULL; in ec_param_explicit_to_text() local 451 cofactor = EC_GROUP_get0_cofactor(group); in ec_param_explicit_to_text() 458 || (cofactor != NULL in ec_param_explicit_to_text() 459 && !print_labeled_bignum(out, "Cofactor: ", cofactor)) in ec_param_explicit_to_text()
|
/openssl/providers/implementations/exchange/ |
H A D | ecdh_exch.c | 482 const BIGNUM *cofactor; in ecdh_plain_derive() local 501 || (cofactor = EC_GROUP_get0_cofactor(group)) == NULL) in ecdh_plain_derive() 504 has_cofactor = !BN_is_one(cofactor); in ecdh_plain_derive()
|
/openssl/providers/implementations/keymgmt/ |
H A D | ec_kmgmt.c | 988 BIGNUM *p, *a, *b, *order, *cofactor; member 1128 COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_COFACTOR, gctx->cofactor); in ec_gen_set_params() 1188 if (gctx->cofactor != NULL in ec_gen_set_group_from_params() 1190 gctx->cofactor)) in ec_gen_set_group_from_params() 1412 BN_free(gctx->cofactor); in ec_gen_cleanup()
|
/openssl/test/ |
H A D | endecode_test.c | 1171 BIGNUM *a, *b, *poly, *order, *cofactor; in do_create_ec_explicit_trinomial_params() local 1200 && TEST_ptr(cofactor = BN_CTX_get(bnctx)) in do_create_ec_explicit_trinomial_params() 1205 && TEST_ptr(BN_bin2bn(cofactor_data, sizeof(cofactor_data), cofactor)) in do_create_ec_explicit_trinomial_params() 1217 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/man5/ |
H A D | fips_config.pod | 193 =item B<ecdh-cofactor-check>
|
/openssl/doc/internal/man7/ |
H A D | EVP_PKEY.pod | 87 It's possible to flip the ECDH cofactor mode.
|
/openssl/doc/designs/ |
H A D | fips_indicator.md | 277 … to check that OSSL_PKEY_PARAM_USE_COFACTOR_ECDH is set for key agreement if the cofactor is not 1.
|