Home
last modified time | relevance | path

Searched refs:eckey (Results 1 – 25 of 33) sorted by relevance

12

/freebsd/crypto/openssl/crypto/ec/
H A Dec_key.c29 static int ecdsa_keygen_pairwise_test(EC_KEY *eckey, OSSL_CALLBACK *cb,
204 ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey) in EC_KEY_get0_engine() argument
206 return eckey->engine; in EC_KEY_get0_engine()
209 int EC_KEY_generate_key(EC_KEY *eckey) in EC_KEY_generate_key() argument
211 if (eckey == NULL || eckey->group == NULL) { in EC_KEY_generate_key()
215 if (eckey->meth->keygen != NULL) { in EC_KEY_generate_key()
218 ret = eckey->meth->keygen(eckey); in EC_KEY_generate_key()
220 eckey->dirty_cnt++; in EC_KEY_generate_key()
228 int ossl_ec_key_gen(EC_KEY *eckey) in ossl_ec_key_gen() argument
232 ret = eckey->group->meth->keygen(eckey); in ossl_ec_key_gen()
[all …]
H A Decdsa_sign.c20 ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey) in ECDSA_do_sign() argument
22 return ECDSA_do_sign_ex(dgst, dlen, NULL, NULL, eckey); in ECDSA_do_sign()
27 EC_KEY *eckey) in ECDSA_do_sign_ex() argument
29 if (eckey->meth->sign_sig != NULL) in ECDSA_do_sign_ex()
30 return eckey->meth->sign_sig(dgst, dlen, kinv, rp, eckey); in ECDSA_do_sign_ex()
36 *sig, unsigned int *siglen, EC_KEY *eckey) in ECDSA_sign() argument
38 return ECDSA_sign_ex(type, dgst, dlen, sig, siglen, NULL, NULL, eckey); in ECDSA_sign()
43 const BIGNUM *r, EC_KEY *eckey) in ECDSA_sign_ex() argument
45 if (eckey->meth->sign != NULL) in ECDSA_sign_ex()
46 return eckey->meth->sign(type, dgst, dlen, sig, siglen, kinv, r, eckey); in ECDSA_sign_ex()
[all …]
H A Decdsa_ossl.c32 int ossl_ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, in ossl_ecdsa_sign_setup() argument
35 if (eckey->group->meth->ecdsa_sign_setup == NULL) { in ossl_ecdsa_sign_setup()
40 return eckey->group->meth->ecdsa_sign_setup(eckey, ctx_in, kinvp, rp); in ossl_ecdsa_sign_setup()
45 EC_KEY *eckey) in ossl_ecdsa_sign_sig() argument
47 if (eckey->group->meth->ecdsa_sign_sig == NULL) { in ossl_ecdsa_sign_sig()
52 return eckey->group->meth->ecdsa_sign_sig(dgst, dgst_len, in ossl_ecdsa_sign_sig()
53 in_kinv, in_r, eckey); in ossl_ecdsa_sign_sig()
57 const ECDSA_SIG *sig, EC_KEY *eckey) in ossl_ecdsa_verify_sig() argument
59 if (eckey->group->meth->ecdsa_verify_sig == NULL) { in ossl_ecdsa_verify_sig()
64 return eckey->group->meth->ecdsa_verify_sig(dgst, dgst_len, sig, eckey); in ossl_ecdsa_verify_sig()
[all …]
H A Decdsa_vrf.c27 const ECDSA_SIG *sig, EC_KEY *eckey) in ECDSA_do_verify() argument
29 if (eckey->meth->verify_sig != NULL) in ECDSA_do_verify()
30 return eckey->meth->verify_sig(dgst, dgst_len, sig, eckey); in ECDSA_do_verify()
42 const unsigned char *sigbuf, int sig_len, EC_KEY *eckey) in ECDSA_verify() argument
44 if (eckey->meth->verify != NULL) in ECDSA_verify()
45 return eckey->meth->verify(type, dgst, dgst_len, sigbuf, sig_len, in ECDSA_verify()
46 eckey); in ECDSA_verify()
H A Dec_ameth.c104 EC_KEY *eckey = NULL; in eckey_pub_decode() local
112 eckey = ossl_ec_key_param_from_x509_algor(palg, libctx, propq); in eckey_pub_decode()
114 if (!eckey) in eckey_pub_decode()
118 if (!o2i_ECPublicKey(&eckey, &p, pklen)) { in eckey_pub_decode()
123 EVP_PKEY_assign_EC_KEY(pkey, eckey); in eckey_pub_decode()
127 EC_KEY_free(eckey); in eckey_pub_decode()
152 EC_KEY *eckey = ossl_ec_key_from_pkcs8(p8, libctx, propq); in eckey_priv_decode_ex() local
154 if (eckey != NULL) { in eckey_priv_decode_ex()
156 EVP_PKEY_assign_EC_KEY(pkey, eckey); in eckey_priv_decode_ex()
349 EC_KEY *eckey; in eckey_param_decode() local
[all …]
H A Dec_kmeth.c155 const EC_KEY *eckey, in ECDH_compute_key() argument
161 if (eckey->meth->compute_key == NULL) { in ECDH_compute_key()
169 if (!eckey->meth->compute_key(&sec, &seclen, pub_key, eckey)) in ECDH_compute_key()
238 EC_KEY *eckey), in EC_KEY_METHOD_set_sign() argument
239 int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, in EC_KEY_METHOD_set_sign() argument
245 EC_KEY *eckey)) in EC_KEY_METHOD_set_sign()
256 int sig_len, EC_KEY *eckey), in EC_KEY_METHOD_set_verify() argument
260 EC_KEY *eckey)) in EC_KEY_METHOD_set_verify()
313 EC_KEY *eckey), in EC_KEY_METHOD_get_sign() argument
314 int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, in EC_KEY_METHOD_get_sign() argument
[all …]
H A Dec_local.h167 size_t (*priv2oct)(const EC_KEY *eckey, unsigned char *buf, size_t len);
168 int (*oct2priv)(EC_KEY *eckey, const unsigned char *buf, size_t len);
169 int (*set_private)(EC_KEY *eckey, const BIGNUM *priv_key);
170 int (*keygen)(EC_KEY *eckey);
171 int (*keycheck)(const EC_KEY *eckey);
172 int (*keygenpub)(EC_KEY *eckey);
174 void (*keyfinish)(EC_KEY *eckey);
179 int (*ecdsa_sign_setup)(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinvp,
183 EC_KEY *eckey);
185 const ECDSA_SIG *sig, EC_KEY *eckey);
[all …]
H A Decp_s390x_nistp.c129 EC_KEY *eckey, in ecdsa_s390x_nistp_sign_sig() argument
140 group = EC_KEY_get0_group(eckey); in ecdsa_s390x_nistp_sign_sig()
141 privkey = EC_KEY_get0_private_key(eckey); in ecdsa_s390x_nistp_sign_sig()
147 if (!EC_KEY_can_sign(eckey)) { in ecdsa_s390x_nistp_sign_sig()
186 if (RAND_priv_bytes_ex(eckey->libctx, param + S390X_OFF_RN(len), in ecdsa_s390x_nistp_sign_sig()
225 const ECDSA_SIG *sig, EC_KEY *eckey, in ecdsa_s390x_nistp_verify_sig() argument
236 group = EC_KEY_get0_group(eckey); in ecdsa_s390x_nistp_verify_sig()
237 pubkey = EC_KEY_get0_public_key(eckey); in ecdsa_s390x_nistp_verify_sig()
238 if (eckey == NULL || group == NULL || pubkey == NULL || sig == NULL) { in ecdsa_s390x_nistp_verify_sig()
243 if (!EC_KEY_can_sign(eckey)) { in ecdsa_s390x_nistp_verify_sig()
[all …]
H A Dec_backend.c771 EC_KEY *eckey = NULL; in ossl_ec_key_param_from_x509_algor() local
775 if ((eckey = EC_KEY_new_ex(libctx, propq)) == NULL) { in ossl_ec_key_param_from_x509_algor()
786 if (d2i_ECParameters(&eckey, &pm, pmlen) == NULL) { in ossl_ec_key_param_from_x509_algor()
801 if (EC_KEY_set_group(eckey, group) == 0) in ossl_ec_key_param_from_x509_algor()
809 return eckey; in ossl_ec_key_param_from_x509_algor()
812 EC_KEY_free(eckey); in ossl_ec_key_param_from_x509_algor()
822 EC_KEY *eckey = NULL; in ossl_ec_key_from_pkcs8() local
827 eckey = ossl_ec_key_param_from_x509_algor(palg, libctx, propq); in ossl_ec_key_from_pkcs8()
828 if (eckey == NULL) in ossl_ec_key_from_pkcs8()
832 if (!d2i_ECPrivateKey(&eckey, &p, pklen)) { in ossl_ec_key_from_pkcs8()
[all …]
H A Dec_pmeth.c173 EC_KEY *eckey; in pkey_ec_derive() local
187 eckey = dctx->co_key ? dctx->co_key in pkey_ec_derive()
192 group = EC_KEY_get0_group(eckey); in pkey_ec_derive()
208 ret = ECDH_compute_key(key, outlen, pubkey, eckey, 0); in pkey_ec_derive()
/freebsd/crypto/openssl/doc/man3/
H A DECDSA_sign.pod18 int ECDSA_size(const EC_KEY *eckey);
21 unsigned char *sig, unsigned int *siglen, EC_KEY *eckey);
23 EC_KEY *eckey);
26 const unsigned char *sig, int siglen, EC_KEY *eckey);
28 const ECDSA_SIG *sig, EC_KEY* eckey);
32 EC_KEY *eckey);
33 int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **rp);
36 const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey);
50 created with the private EC key I<eckey>. To obtain the actual signature
54 I<dgst> using the private EC key I<eckey>. The DER encoded signatures is
[all …]
H A DEC_KEY_new.pod42 ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey);
50 void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
51 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
59 int EC_KEY_oct2key(EC_KEY *eckey, const unsigned char *buf, size_t len, BN_CTX *ctx);
60 size_t EC_KEY_key2buf(const EC_KEY *eckey, point_conversion_form_t form,
63 int EC_KEY_oct2priv(EC_KEY *eckey, const unsigned char *buf, size_t len);
64 size_t EC_KEY_priv2oct(const EC_KEY *eckey, unsigned char *buf, size_t len);
66 size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf);
121 I<eckey> object. I<eckey> must have an EC_GROUP object associated with it
170 EC_POINT in I<eckey>.
[all …]
/freebsd/crypto/openssl/apps/
H A Dec.c69 EVP_PKEY *eckey = NULL; in ec_main() local
180 eckey = load_pubkey(infile, informat, 1, passin, e, "public key"); in ec_main()
182 eckey = load_key(infile, informat, 1, passin, e, "private key"); in ec_main()
184 if (eckey == NULL) { in ec_main()
195 eckey, OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, in ec_main()
203 eckey, OSSL_PKEY_PARAM_EC_ENCODING, asn1_encoding)) { in ec_main()
209 if (!EVP_PKEY_set_int_param(eckey, OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0)) { in ec_main()
214 if (!EVP_PKEY_set_int_param(eckey, OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 1)) { in ec_main()
222 if ((pubin && EVP_PKEY_print_public(out, eckey, 0, NULL) <= 0) in ec_main()
223 || (!pubin && EVP_PKEY_print_private(out, eckey, 0, NULL) <= 0)) { in ec_main()
[all …]
/freebsd/crypto/openssl/include/crypto/
H A Dec.h62 int ossl_ec_key_public_check(const EC_KEY *eckey, BN_CTX *ctx);
63 int ossl_ec_key_public_check_quick(const EC_KEY *eckey, BN_CTX *ctx);
64 int ossl_ec_key_private_check(const EC_KEY *eckey);
65 int ossl_ec_key_pairwise_check(const EC_KEY *eckey, BN_CTX *ctx);
66 OSSL_LIB_CTX *ossl_ec_key_get_libctx(const EC_KEY *eckey);
67 const char *ossl_ec_key_get0_propq(const EC_KEY *eckey);
H A Dsm2.h23 int ossl_sm2_key_private_check(const EC_KEY *eckey);
55 EC_KEY *eckey);
62 EC_KEY *eckey);
/freebsd/crypto/openssl/include/openssl/
H A Dec.h1028 OSSL_DEPRECATEDIN_3_0 ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey);
1073 OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
1075 OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_conv_form(EC_KEY *eckey,
1087 OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
1113 OSSL_DEPRECATEDIN_3_0 int EC_KEY_can_sign(const EC_KEY *eckey);
1174 OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2buf(const EC_KEY *eckey,
1366 int dgst_len, EC_KEY *eckey);
1380 const BIGNUM *rp, EC_KEY *eckey);
1392 const ECDSA_SIG *sig, EC_KEY *eckey);
1401 OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx,
[all …]
/freebsd/crypto/openssl/crypto/sm2/
H A Dsm2_key.c22 int ossl_sm2_key_private_check(const EC_KEY *eckey) in ossl_sm2_key_private_check() argument
29 if (eckey == NULL in ossl_sm2_key_private_check()
30 || (group = EC_KEY_get0_group(eckey)) == NULL in ossl_sm2_key_private_check()
31 || (priv_key = EC_KEY_get0_private_key(eckey)) == NULL in ossl_sm2_key_private_check()
H A Dsm2_sign.c445 EC_KEY *eckey) in ossl_sm2_internal_sign()
463 s = sm2_sig_gen(eckey, e); in ossl_sm2_internal_sign()
486 EC_KEY *eckey) in ossl_sm2_internal_verify()
517 ret = sm2_sig_verify(eckey, s, e);
438 ossl_sm2_internal_sign(const unsigned char * dgst,int dgstlen,unsigned char * sig,unsigned int * siglen,EC_KEY * eckey) ossl_sm2_internal_sign() argument
474 ossl_sm2_internal_verify(const unsigned char * dgst,int dgstlen,const unsigned char * sig,int sig_len,EC_KEY * eckey) ossl_sm2_internal_verify() argument
/freebsd/crypto/openssl/test/
H A Decdsatest.c190 EC_KEY *eckey_neg = NULL, *eckey = NULL; in test_builtin() local
228 || !TEST_ptr(eckey = EC_KEY_new_by_curve_name(nid)) in test_builtin()
229 || !TEST_true(EC_KEY_generate_key(eckey)) in test_builtin()
231 || !TEST_true(EVP_PKEY_assign_EC_KEY(pkey, eckey)) in test_builtin()
244 temp = ECDSA_size(eckey); in test_builtin()
252 || !TEST_int_le(sig_len, ECDSA_size(eckey)) in test_builtin()
356 EC_KEY *eckey = NULL; in test_ecdsa_sig_NULL()
360 ret = TEST_ptr(eckey = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1)) in test_ecdsa_sig_NULL()
361 && TEST_int_eq(EC_KEY_generate_key(eckey), 1) in test_ecdsa_sig_NULL()
363 eckey), in test_ecdsa_sig_NULL()
355 EC_KEY *eckey = NULL; test_ecdsa_sig_NULL() local
[all...]
/freebsd/crypto/openssl/crypto/pem/
H A Dpem_all.c34 static EC_KEY *pkey_get_eckey(EVP_PKEY *key, EC_KEY **eckey);
134 static EC_KEY *pkey_get_eckey(EVP_PKEY *key, EC_KEY **eckey) in IMPLEMENT_PEM_rw()
143 if (eckey) { in IMPLEMENT_PEM_rw()
144 EC_KEY_free(*eckey); in IMPLEMENT_PEM_rw()
145 *eckey = dtmp; in IMPLEMENT_PEM_rw()
166 EC_KEY *PEM_read_ECPrivateKey(FILE *fp, EC_KEY **eckey, pem_password_cb *cb, in IMPLEMENT_PEM_rw()
171 return pkey_get_eckey(pktmp, eckey); /* will free pktmp */ in IMPLEMENT_PEM_rw()
/freebsd/contrib/wpa/src/crypto/
H A Dcrypto_wolfssl.c2078 ecc_key *eckey; member
2167 ret->ec->key = own_key->eckey; in crypto_ecdh_init2()
2301 key->eckey = ecc_key_init(); in crypto_ec_key_init()
2305 if (!key->eckey) { in crypto_ec_key_init()
2318 ecc_key_deinit(key->eckey); in crypto_ec_key_deinit()
2349 err = wc_EccPrivateKeyDecode(der, &idx, ret->eckey, (word32) der_len); in crypto_ec_key_parse_priv()
2366 if (!key || !key->eckey || !key->eckey->dp) { in crypto_ec_key_group()
2371 switch (key->eckey->dp->id) { in crypto_ec_key_group()
2395 key->eckey->dp->id); in crypto_ec_key_group()
2405 err = wc_ecc_make_pub(key->eckey, NULL); in crypto_ec_key_gen_public_key()
[all …]
H A Dcrypto_openssl.c2793 EC_KEY *eckey; in crypto_ecdh_get_pubkey()
2799 eckey = EVP_PKEY_get1_EC_KEY(ecdh->pkey); in crypto_ecdh_get_pubkey()
2800 if (!eckey) in crypto_ecdh_get_pubkey()
2803 pubkey = EC_KEY_get0_public_key(eckey); in crypto_ecdh_get_pubkey()
2840 EC_KEY_free(eckey); in crypto_ecdh_get_pubkey()
2906 EC_KEY *eckey = NULL; in crypto_ecdh_set_peerkey()
2939 eckey = EC_KEY_new_by_curve_name(ecdh->ec->nid); in crypto_ecdh_set_peerkey()
2940 if (!eckey || EC_KEY_set_public_key(eckey, pub) != 1) { in crypto_ecdh_set_peerkey()
2948 if (!peerkey || EVP_PKEY_set1_EC_KEY(peerkey, eckey) != 1) in crypto_ecdh_set_peerkey()
2979 EC_KEY_free(eckey); in crypto_ecdh_set_peerkey()
[all …]
/freebsd/crypto/openssl/crypto/x509/
H A Dx_all.c404 EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey) in d2i_EC_PUBKEY_fp() argument
406 return ASN1_d2i_fp_of(EC_KEY, EC_KEY_new, d2i_EC_PUBKEY, fp, eckey); in d2i_EC_PUBKEY_fp()
409 int i2d_EC_PUBKEY_fp(FILE *fp, const EC_KEY *eckey) in i2d_EC_PUBKEY_fp() argument
411 return ASN1_i2d_fp_of(EC_KEY, i2d_EC_PUBKEY, fp, eckey); in i2d_EC_PUBKEY_fp()
414 EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey) in d2i_ECPrivateKey_fp() argument
416 return ASN1_d2i_fp_of(EC_KEY, EC_KEY_new, d2i_ECPrivateKey, fp, eckey); in d2i_ECPrivateKey_fp()
419 int i2d_ECPrivateKey_fp(FILE *fp, const EC_KEY *eckey) in i2d_ECPrivateKey_fp() argument
421 return ASN1_i2d_fp_of(EC_KEY, i2d_ECPrivateKey, fp, eckey); in i2d_ECPrivateKey_fp()
424 EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey) in d2i_EC_PUBKEY_bio() argument
426 return ASN1_d2i_bio_of(EC_KEY, EC_KEY_new, d2i_EC_PUBKEY, bp, eckey); in d2i_EC_PUBKEY_bio()
[all …]
/freebsd/crypto/openssl/providers/implementations/encode_decode/
H A Dencode_key2any.c642 static int prepare_ec_explicit_params(const void *eckey, in prepare_ec_explicit_params() argument
652 params->length = i2d_ECParameters(eckey, &params->data); in prepare_ec_explicit_params()
668 static int prepare_ec_params(const void *eckey, int nid, int save, in prepare_ec_params() argument
672 const EC_GROUP *group = EC_KEY_get0_group(eckey); in prepare_ec_params()
698 return prepare_ec_explicit_params(eckey, pstr, pstrtype); in prepare_ec_params()
702 static int ec_spki_pub_to_der(const void *eckey, unsigned char **pder) in ec_spki_pub_to_der() argument
704 if (EC_KEY_get0_public_key(eckey) == NULL) { in ec_spki_pub_to_der()
708 return i2o_ECPublicKey(eckey, pder); in ec_spki_pub_to_der()
713 EC_KEY *eckey = (EC_KEY *)veckey; in ec_pki_priv_to_der() local
724 old_flags = EC_KEY_get_enc_flags(eckey); /* save old flags */ in ec_pki_priv_to_der()
[all …]
/freebsd/crypto/openssl/providers/implementations/keymgmt/
H A Dec_kmgmt.c111 int key_to_params(const EC_KEY *eckey, OSSL_PARAM_BLD *tmpl, in key_to_params() argument
123 if (eckey == NULL in key_to_params()
124 || (ecg = EC_KEY_get0_group(eckey)) == NULL) in key_to_params()
127 priv_key = EC_KEY_get0_private_key(eckey); in key_to_params()
128 pub_point = EC_KEY_get0_public_key(eckey); in key_to_params()
136 bnctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(eckey)); in key_to_params()
150 point_conversion_form_t format = EC_KEY_get_conv_form(eckey); in key_to_params()

12