Home
last modified time | relevance | path

Searched refs:priv_key (Results 1 – 25 of 105) sorted by relevance

12345

/freebsd/crypto/openssl/crypto/dsa/
H A Ddsa_key.c43 const BIGNUM *priv_key, BIGNUM *pub_key) in ossl_dsa_generate_public_key() argument
50 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in ossl_dsa_generate_public_key()
93 if (!ossl_dsa_generate_public_key(ctx, dsa, dsa->priv_key, pub_key2)) in dsa_keygen_knownanswer_test()
151 BIGNUM *pub_key = NULL, *priv_key = NULL; in dsa_keygen() local
156 if (dsa->priv_key == NULL) { in dsa_keygen()
157 if ((priv_key = BN_secure_new()) == NULL) in dsa_keygen()
160 priv_key = dsa->priv_key; in dsa_keygen()
175 MIN_STRENGTH, priv_key)) in dsa_keygen()
185 if (!ossl_dsa_generate_public_key(ctx, dsa, priv_key, pub_key)) in dsa_keygen()
188 dsa->priv_key = priv_key; in dsa_keygen()
[all …]
H A Ddsa_lib.c49 BIGNUM *pub_key = NULL, *priv_key = NULL; in DSA_dup_DH() local
64 if (r->priv_key != NULL) { in DSA_dup_DH()
65 priv_key = BN_dup(r->priv_key); in DSA_dup_DH()
66 if (priv_key == NULL) in DSA_dup_DH()
69 if (!DH_set0_key(ret, pub_key, priv_key)) in DSA_dup_DH()
71 } else if (r->priv_key != NULL) { in DSA_dup_DH()
80 BN_free(priv_key); in DSA_dup_DH()
240 BN_clear_free(r->priv_key); in DSA_free()
305 return d->priv_key; in DSA_get0_priv_key()
309 const BIGNUM **pub_key, const BIGNUM **priv_key) in DSA_get0_key() argument
[all …]
H A Ddsa_backend.c34 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dsa_key_fromdata() local
50 if (param_priv_key != NULL && !OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_dsa_key_fromdata()
53 if (!DSA_set0_key(dsa, pub_key, priv_key)) in ossl_dsa_key_fromdata()
59 BN_clear_free(priv_key); in ossl_dsa_key_fromdata()
104 || !dsa_bn_dup_check(&dupkey->priv_key, dsa->priv_key))) in ossl_dsa_dup()
/freebsd/crypto/libecc/src/tests/
H A Ded25519_test_vectors.h21 .priv_key = ed25519_1_test_vectors_priv_key,
44 .priv_key = ed25519_2_test_vectors_priv_key,
67 .priv_key = ed25519_3_test_vectors_priv_key,
90 .priv_key = ed25519_4_test_vectors_priv_key,
113 .priv_key = ed25519_5_test_vectors_priv_key,
136 .priv_key = ed25519_6_test_vectors_priv_key,
159 .priv_key = ed25519_7_test_vectors_priv_key,
182 .priv_key = ed25519_8_test_vectors_priv_key,
205 .priv_key = ed25519_9_test_vectors_priv_key,
228 .priv_key = ed25519_10_test_vectors_priv_key,
[all …]
H A Ddecdsa_test_vectors.h31 .priv_key = decdsa_rfc6979_SECP192R1_SHA224_0_test_vector_priv_key,
66 .priv_key = decdsa_rfc6979_SECP192R1_SHA256_0_test_vector_priv_key,
101 .priv_key = decdsa_rfc6979_SECP192R1_SHA384_0_test_vector_priv_key,
136 .priv_key = decdsa_rfc6979_SECP192R1_SHA512_0_test_vector_priv_key,
171 .priv_key = decdsa_rfc6979_SECP192R1_SHA224_1_test_vector_priv_key,
206 .priv_key = decdsa_rfc6979_SECP192R1_SHA256_1_test_vector_priv_key,
241 .priv_key = decdsa_rfc6979_SECP192R1_SHA384_1_test_vector_priv_key,
276 .priv_key = decdsa_rfc6979_SECP192R1_SHA512_1_test_vector_priv_key,
314 .priv_key = decdsa_rfc6979_SECP256R1_SHA224_0_test_vector_priv_key,
352 .priv_key = decdsa_rfc6979_SECP256R1_SHA256_0_test_vector_priv_key,
[all …]
H A Ded448_test_vectors.h24 .priv_key = ed448_1_test_vectors_priv_key,
47 .priv_key = ed448_2_test_vectors_priv_key,
70 .priv_key = ed448_3_test_vectors_priv_key,
96 .priv_key = ed448_4_test_vectors_priv_key,
122 .priv_key = ed448_5_test_vectors_priv_key,
148 .priv_key = ed448_6_test_vectors_priv_key,
174 .priv_key = ed448_7_test_vectors_priv_key,
263 .priv_key = ed448_8_test_vectors_priv_key,
292 .priv_key = ed448_9_test_vectors_priv_key,
H A Dec_self_tests_core.h30 const u8 *priv_key; member
173 .priv_key = ecdsa_secp224r1_sha3_224_test_vectors_priv_key,
241 .priv_key = ecdsa_secp256r1_sha3_256_test_vectors_priv_key,
309 .priv_key = ecdsa_secp256r1_sha3_512_test_vectors_priv_key,
385 .priv_key = ecdsa_secp384r1_sha3_384_test_vectors_priv_key,
472 .priv_key = ecdsa_secp521r1_sha3_512_test_vectors_priv_key,
532 .priv_key = ecdsa_secp192r1_test_vectors_priv_key,
598 .priv_key = ecdsa_secp224r1_test_vectors_priv_key,
664 .priv_key = ecdsa_secp256r1_test_vectors_priv_key,
731 .priv_key = ecdsa_secp256r1_sha512_test_vectors_priv_key,
[all …]
H A Ddbign_test_vectors.h31 .priv_key = dbign_1_test_vectors_priv_key,
61 .priv_key = dbign_2_test_vectors_priv_key,
91 .priv_key = dbign_3_test_vectors_priv_key,
121 .priv_key = dbign_4_test_vectors_priv_key,
148 .priv_key = dbign_5_test_vectors_priv_key,
179 .priv_key = dbign_6_test_vectors_priv_key,
206 .priv_key = dbign_7_test_vectors_priv_key,
H A Dbign_test_vectors.h50 .priv_key = bign_1_test_vectors_priv_key,
101 .priv_key = bign_2_test_vectors_priv_key,
149 .priv_key = bign_3_test_vectors_priv_key,
200 .priv_key = bign_4_test_vectors_priv_key,
256 .priv_key = bign_5_test_vectors_priv_key,
310 .priv_key = bign_6_test_vectors_priv_key,
367 .priv_key = bign_7_test_vectors_priv_key,
423 .priv_key = bign_8_test_vectors_priv_key,
/freebsd/crypto/libecc/include/libecc/sig/
H A Dec_key.h75 #define EC_PRIV_KEY_EXPORT_SIZE(priv_key) \ argument
76 …LOCAL_MAX(MAX_DIGEST_SIZE, LOCAL_MAX(BYTECEIL((priv_key)->params->ec_gen_order_bitlen), BYTECEIL((
82 #define EC_PRIV_KEY_EXPORT_SIZE(priv_key) \ argument
83 …((u8)(LOCAL_MAX(BYTECEIL((priv_key)->params->ec_gen_order_bitlen), BYTECEIL((priv_key)->params->ec…
92 #define EC_STRUCTURED_PRIV_KEY_EXPORT_SIZE(priv_key) \ argument
93 ((u8)(EC_PRIV_KEY_EXPORT_SIZE(priv_key) + (3 * sizeof(u8))))
99 ATTRIBUTE_WARN_UNUSED_RET int ec_priv_key_import_from_buf(ec_priv_key *priv_key,
103 ATTRIBUTE_WARN_UNUSED_RET int ec_priv_key_export_to_buf(const ec_priv_key *priv_key, u8 *priv_key_b…
106 ATTRIBUTE_WARN_UNUSED_RET int ec_structured_priv_key_import_from_buf(ec_priv_key *priv_key,
111 ATTRIBUTE_WARN_UNUSED_RET int ec_structured_priv_key_export_to_buf(const ec_priv_key *priv_key,
[all …]
/freebsd/crypto/openssl/crypto/ec/
H A Dec_key.c100 BN_clear_free(r->priv_key); in EC_KEY_free()
145 if (src->priv_key != NULL) { in EC_KEY_copy()
146 if (dest->priv_key == NULL) { in EC_KEY_copy()
147 dest->priv_key = BN_new(); in EC_KEY_copy()
148 if (dest->priv_key == NULL) in EC_KEY_copy()
151 if (!BN_copy(dest->priv_key, src->priv_key)) in EC_KEY_copy()
271 if (!EC_POINT_mul(eckey->group, pub_key2, eckey->priv_key, NULL, NULL, ctx)) in ecdsa_keygen_knownanswer_test()
304 BIGNUM *priv_key = NULL; in ec_generate_key() local
315 if (eckey->priv_key == NULL) { in ec_generate_key()
316 priv_key = BN_secure_new(); in ec_generate_key()
[all …]
H A Decdh_ossl.c55 const BIGNUM *priv_key; in ossl_ecdh_simple_compute_key() local
70 priv_key = EC_KEY_get0_private_key(ecdh); in ossl_ecdh_simple_compute_key()
71 if (priv_key == NULL) { in ossl_ecdh_simple_compute_key()
87 if (!BN_mul(x, x, priv_key, ctx)) { in ossl_ecdh_simple_compute_key()
91 priv_key = x; in ossl_ecdh_simple_compute_key()
99 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { in ossl_ecdh_simple_compute_key()
H A Dec_asn1.c924 EC_PRIVATEKEY *priv_key = NULL; in d2i_ECPrivateKey() local
927 if ((priv_key = d2i_EC_PRIVATEKEY(NULL, &p, len)) == NULL) in d2i_ECPrivateKey()
938 if (priv_key->parameters) { in d2i_ECPrivateKey()
940 ret->group = EC_GROUP_new_from_ecpkparameters(priv_key->parameters); in d2i_ECPrivateKey()
942 && priv_key->parameters->type == ECPKPARAMETERS_TYPE_EXPLICIT) in d2i_ECPrivateKey()
951 ret->version = priv_key->version; in d2i_ECPrivateKey()
953 if (priv_key->privateKey) { in d2i_ECPrivateKey()
954 ASN1_OCTET_STRING *pkey = priv_key->privateKey; in d2i_ECPrivateKey()
974 if (priv_key->publicKey) { in d2i_ECPrivateKey()
978 pub_oct = ASN1_STRING_get0_data(priv_key->publicKey); in d2i_ECPrivateKey()
[all …]
/freebsd/crypto/libecc/src/sig/
H A Dec_key.c56 int ec_priv_key_import_from_buf(ec_priv_key *priv_key, in ec_priv_key_import_from_buf() argument
63 MUST_HAVE((priv_key != NULL), ret, err); in ec_priv_key_import_from_buf()
65 ret = nn_init_from_buf(&(priv_key->x), priv_key_buf, priv_key_buf_len); EG(ret, err); in ec_priv_key_import_from_buf()
68 priv_key->key_type = ec_key_alg; in ec_priv_key_import_from_buf()
69 priv_key->params = (const ec_params *)params; in ec_priv_key_import_from_buf()
70 priv_key->magic = PRIV_KEY_MAGIC; in ec_priv_key_import_from_buf()
80 int ec_priv_key_export_to_buf(const ec_priv_key *priv_key, u8 *priv_key_buf, in ec_priv_key_export_to_buf() argument
86 ret = priv_key_check_initialized(priv_key); EG(ret, err); in ec_priv_key_export_to_buf()
92 ret = nn_bitlen(&(priv_key->x), &blen); EG(ret, err); in ec_priv_key_export_to_buf()
96 ret = nn_export_to_buf(priv_key_buf, priv_key_buf_len, &(priv_key->x)); in ec_priv_key_export_to_buf()
[all …]
H A Dfuzzing_ecdsa.c43 const ec_priv_key *priv_key; in ecdsa_sign_raw() local
75 priv_key = &(ctx->key_pair->priv_key); in ecdsa_sign_raw()
76 q = &(priv_key->params->ec_gen_order); in ecdsa_sign_raw()
77 q_bit_len = priv_key->params->ec_gen_order_bitlen; in ecdsa_sign_raw()
78 G = &(priv_key->params->ec_gen); in ecdsa_sign_raw()
80 x = &(priv_key->x); in ecdsa_sign_raw()
83 dbg_nn_print("p", &(priv_key->params->ec_fp.p)); in ecdsa_sign_raw()
84 dbg_nn_print("q", &(priv_key->params->ec_gen_order)); in ecdsa_sign_raw()
85 dbg_priv_key_print("x", priv_key); in ecdsa_sign_raw()
86 dbg_ec_point_print("G", &(priv_key->params->ec_gen)); in ecdsa_sign_raw()
[all …]
H A Decsdsa_common.c146 const ec_priv_key *priv_key; in __ecsdsa_sign_init() local
168 priv_key = &(ctx->key_pair->priv_key); in __ecsdsa_sign_init()
169 G = &(priv_key->params->ec_gen); in __ecsdsa_sign_init()
170 q = &(priv_key->params->ec_gen_order); in __ecsdsa_sign_init()
171 p_bit_len = priv_key->params->ec_fp.p_bitlen; in __ecsdsa_sign_init()
174 dbg_nn_print("p", &(priv_key->params->ec_fp.p)); in __ecsdsa_sign_init()
176 dbg_priv_key_print("x", priv_key); in __ecsdsa_sign_init()
230 PTR_NULLIFY(priv_key); in __ecsdsa_sign_init()
275 const ec_priv_key *priv_key; in __ecsdsa_sign_finalize() local
299 priv_key = &(ctx->key_pair->priv_key); in __ecsdsa_sign_finalize()
[all …]
/freebsd/crypto/libecc/src/ecdh/
H A Dx25519_448.c304 ATTRIBUTE_WARN_UNUSED_RET static int x25519_448_gen_priv_key(u8 *priv_key, u8 len) in x25519_448_gen_priv_key() argument
308 MUST_HAVE((priv_key != NULL), ret, err); in x25519_448_gen_priv_key()
312 ret = get_random(priv_key, len); in x25519_448_gen_priv_key()
319 ATTRIBUTE_WARN_UNUSED_RET static int x25519_448_init_pub_key(const u8 *priv_key, u8 *pub_key, u8 le… in x25519_448_init_pub_key() argument
323 MUST_HAVE((priv_key != NULL) && (pub_key != NULL), ret, err); in x25519_448_init_pub_key()
342 ret = x25519_448_core(priv_key, u, pub_key, len); in x25519_448_init_pub_key()
350 ret = x25519_448_core(priv_key, u, pub_key, len); in x25519_448_init_pub_key()
359 ATTRIBUTE_WARN_UNUSED_RET static int x25519_448_derive_secret(const u8 *priv_key, const u8 *peer_pu… in x25519_448_derive_secret() argument
363 MUST_HAVE((priv_key != NULL) && (peer_pub_key != NULL) && (shared_secret != NULL), ret, err); in x25519_448_derive_secret()
367 ret = x25519_448_core(priv_key, peer_pub_key, shared_secret, len); in x25519_448_derive_secret()
[all …]
H A Decccdh.c100 kp->priv_key.magic = PRIV_KEY_MAGIC; in ecccdh_gen_key_pair()
101 kp->priv_key.key_type = ECCCDH; in ecccdh_gen_key_pair()
102 kp->priv_key.params = params; in ecccdh_gen_key_pair()
103 ret = generic_gen_priv_key(&(kp->priv_key)); EG(ret, err); in ecccdh_gen_key_pair()
106 ret = ecccdh_init_pub_key(&(kp->pub_key), &(kp->priv_key)); in ecccdh_gen_key_pair()
128 …ret = ec_priv_key_import_from_buf(&(kp->priv_key), params, priv_key_buf, priv_key_buf_len, ECCCDH)… in ecccdh_import_key_pair_from_priv_key_buf()
131 ret = ecccdh_init_pub_key(&(kp->pub_key), &(kp->priv_key)); in ecccdh_import_key_pair_from_priv_key_buf()
/freebsd/crypto/openssl/providers/implementations/keymgmt/
H A Dmac_legacy_kmgmt.c59 unsigned char *priv_key; member
96 OPENSSL_secure_clear_free(mackey->priv_key, mackey->priv_key_len); in ossl_mac_key_free()
150 ok = key->priv_key != NULL; in mac_has()
165 if ((key1->priv_key == NULL && key2->priv_key != NULL) in mac_match()
166 || (key1->priv_key != NULL && key2->priv_key == NULL) in mac_match()
172 ok = ok && (key1->priv_key == NULL /* implies key2->privkey == NULL */ in mac_match()
173 || CRYPTO_memcmp(key1->priv_key, key2->priv_key, key1->priv_key_len) == 0); in mac_match()
190 OPENSSL_secure_clear_free(key->priv_key, key->priv_key_len); in mac_key_fromdata()
192 key->priv_key = OPENSSL_secure_malloc(p->data_size > 0 ? p->data_size : 1); in mac_key_fromdata()
193 if (key->priv_key == NULL) in mac_key_fromdata()
[all …]
/freebsd/crypto/openssl/crypto/dh/
H A Ddh_key.c72 if (dh->priv_key == NULL) { in ossl_dh_compute_key()
80 BN_set_flags(dh->priv_key, BN_FLG_CONSTTIME); in ossl_dh_compute_key()
86 if (!dh->meth->bn_mod_exp(dh, z, pub_key, dh->priv_key, dh->params.p, ctx, in ossl_dh_compute_key()
230 const BIGNUM *priv_key, BIGNUM *pub_key) in ossl_dh_generate_public_key() argument
253 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in ossl_dh_generate_public_key()
273 BIGNUM *pub_key = NULL, *priv_key = NULL; in generate_key() local
295 if (dh->priv_key == NULL) { in generate_key()
296 priv_key = BN_secure_new(); in generate_key()
297 if (priv_key == NULL) in generate_key()
301 priv_key = dh->priv_key; in generate_key()
[all …]
H A Ddh_lib.c163 BN_clear_free(r->priv_key); in DH_free()
259 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
263 if (priv_key != NULL) in DH_get0_key()
264 *priv_key = dh->priv_key; in DH_get0_key()
267 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
273 if (priv_key != NULL) { in DH_set0_key()
274 BN_clear_free(dh->priv_key); in DH_set0_key()
275 dh->priv_key = priv_key; in DH_set0_key()
299 return dh->priv_key; in DH_get0_priv_key()
H A Ddh_backend.c62 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dh_key_fromdata() local
72 && !OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_dh_key_fromdata()
79 if (!DH_set0_key(dh, pub_key, priv_key)) in ossl_dh_key_fromdata()
85 BN_clear_free(priv_key); in ossl_dh_key_fromdata()
163 || !dh_bn_dup_check(&dupkey->priv_key, dh->priv_key))) in ossl_dh_dup()
/freebsd/crypto/libecc/include/libecc/ecdh/
H A Dx25519_448.h36 ATTRIBUTE_WARN_UNUSED_RET int x25519_gen_priv_key(u8 priv_key[X25519_SIZE]);
38 ATTRIBUTE_WARN_UNUSED_RET int x25519_init_pub_key(const u8 priv_key[X25519_SIZE], u8 pub_key[X25519…
40 ATTRIBUTE_WARN_UNUSED_RET int x25519_derive_secret(const u8 priv_key[X25519_SIZE], const u8 peer_pu…
53 ATTRIBUTE_WARN_UNUSED_RET int x448_gen_priv_key(u8 priv_key[X448_SIZE]);
55 ATTRIBUTE_WARN_UNUSED_RET int x448_init_pub_key(const u8 priv_key[X448_SIZE], u8 pub_key[X448_SIZE]…
57 ATTRIBUTE_WARN_UNUSED_RET int x448_derive_secret(const u8 priv_key[X448_SIZE], const u8 peer_pub_ke…
/freebsd/crypto/openssl/crypto/sm2/
H A Dsm2_key.c27 const BIGNUM *priv_key = NULL, *order = NULL; in ossl_sm2_key_private_check() local
31 || (priv_key = EC_KEY_get0_private_key(eckey)) == NULL in ossl_sm2_key_private_check()
41 if (BN_cmp(priv_key, BN_value_one()) < 0 in ossl_sm2_key_private_check()
42 || BN_cmp(priv_key, max) >= 0) { in ossl_sm2_key_private_check()
/freebsd/crypto/openssl/apps/
H A Dtestdsa.h1438 BIGNUM *priv_key, *pub_key, *p, *q, *g; in get_dsa() local
1461 priv_key = BN_bin2bn(dsa_t.priv, dsa_t.priv_l, NULL); in get_dsa()
1466 if (priv_key == NULL || pub_key == NULL || p == NULL || q == NULL in get_dsa()
1478 priv_key) in get_dsa()
1492 BN_free(priv_key); in get_dsa()

12345