Home
last modified time | relevance | path

Searched refs:cofactor (Results 1 – 25 of 32) sorted by relevance

12

/openssl/crypto/ec/
H A Dec_lib.c70 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 Deck_prn.c77 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 Dec_curve.c29 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 Dec_backend.c259 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 Dec_asn1.c75 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 Dec_mult.c159 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 Dec_key.c566 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 Dec_pmeth.c296 if (BN_is_one(ec_key->group->cofactor)) in pkey_ec_ctrl()
H A Dec_local.h215 BIGNUM *order, *cofactor; member
H A Dec2_smpl.c891 if (num > 1 || BN_is_zero(group->order) || BN_is_zero(group->cofactor)) in ec_GF2m_simple_points_mul()
/openssl/doc/man7/
H A DEVP_KEYEXCH-ECDH.pod15 =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 DEVP_PKEY-EC.pod61 =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 DEVP_PKEY-FFC.pod97 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 DEVP_PKEY-SM2.pod25 =item "cofactor" (B<OSSL_PKEY_PARAM_EC_COFACTOR>) <unsigned integer>
/openssl/crypto/cms/
H A Dcms_ec.c127 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 DEC_GROUP_copy.pod27 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 DEVP_PKEY_CTX_ctrl.pod597 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 Dencode_key2text.c434 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 Decdh_exch.c482 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 Dec_kmgmt.c988 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 Dendecode_test.c1171 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 Dec.h222 const BIGNUM *order, const BIGNUM *cofactor);
262 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
/openssl/doc/man5/
H A Dfips_config.pod193 =item B<ecdh-cofactor-check>
/openssl/doc/internal/man7/
H A DEVP_PKEY.pod87 It's possible to flip the ECDH cofactor mode.
/openssl/doc/designs/
H A Dfips_indicator.md277 … to check that OSSL_PKEY_PARAM_USE_COFACTOR_ECDH is set for key agreement if the cofactor is not 1.

Completed in 120 milliseconds

12