Home
last modified time | relevance | path

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

12

/openssl/crypto/dsa/
H A Ddsa_key.c50 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in ossl_dsa_generate_public_key()
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()
188 dsa->priv_key = priv_key; in dsa_keygen()
203 BN_clear_free(dsa->priv_key); in dsa_keygen()
205 dsa->priv_key = NULL; in dsa_keygen()
216 if (priv_key != dsa->priv_key) in dsa_keygen()
[all …]
H A Ddsa_lib.c64 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()
80 BN_free(priv_key); in DSA_dup_DH()
241 BN_clear_free(r->priv_key); in DSA_free()
306 return d->priv_key; in DSA_get0_priv_key()
314 if (priv_key != NULL) in DSA_get0_key()
315 *priv_key = d->priv_key; in DSA_get0_key()
324 if (priv_key != NULL) { in DSA_set0_key()
325 BN_free(d->priv_key); in DSA_set0_key()
[all …]
H A Ddsa_backend.c34 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dsa_key_fromdata() local
52 if (param_priv_key != NULL && !OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_dsa_key_fromdata()
55 if (!DSA_set0_key(dsa, pub_key, priv_key)) in ossl_dsa_key_fromdata()
61 BN_clear_free(priv_key); in ossl_dsa_key_fromdata()
106 || !dsa_bn_dup_check(&dupkey->priv_key, dsa->priv_key))) in ossl_dsa_dup()
H A Ddsa_check.c89 int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret) in ossl_dsa_check_priv_key() argument
96 return ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret); in ossl_dsa_check_priv_key()
113 || dsa->priv_key == NULL in ossl_dsa_check_pairwise()
125 if (!ossl_dsa_generate_public_key(ctx, dsa, dsa->priv_key, pub_key)) in ossl_dsa_check_pairwise()
H A Ddsa_ameth.c170 if (pkey->pkey.dsa == NULL|| pkey->pkey.dsa->priv_key == NULL) { in dsa_priv_encode()
190 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dsa->priv_key, NULL); in dsa_priv_encode()
276 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local
283 priv_key = x->priv_key; in do_dsa_print()
285 priv_key = NULL; in do_dsa_print()
299 if (priv_key != NULL) { in do_dsa_print()
309 if (!ASN1_bn_print(bp, "priv:", priv_key, NULL, off)) in do_dsa_print()
437 const BIGNUM *priv_key = DSA_get0_priv_key(dsa); in dsa_pkey_export_to() local
460 if (priv_key != NULL) { in dsa_pkey_export_to()
462 priv_key)) in dsa_pkey_export_to()
/openssl/crypto/ec/
H A Dec_key.c100 BN_clear_free(r->priv_key); in EC_KEY_free()
151 if (!BN_copy(dest->priv_key, src->priv_key)) in EC_KEY_copy()
305 BIGNUM *priv_key = NULL; in ec_generate_key() local
318 if (priv_key == NULL) in ec_generate_key()
321 priv_key = eckey->priv_key; in ec_generate_key()
369 eckey->priv_key = priv_key; in ec_generate_key()
371 priv_key = NULL; in ec_generate_key()
399 BN_clear_free(priv_key); in ec_generate_key()
787 return key->priv_key; in EC_KEY_get0_private_key()
822 if (priv_key == NULL) { in EC_KEY_set_private_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.c936 EC_PRIVATEKEY *priv_key = NULL; in d2i_ECPrivateKey() local
950 if (priv_key->parameters) { in d2i_ECPrivateKey()
963 ret->version = priv_key->version; in d2i_ECPrivateKey()
965 if (priv_key->privateKey) { in d2i_ECPrivateKey()
985 if (priv_key->publicKey) { in d2i_ECPrivateKey()
1005 EC_PRIVATEKEY_free(priv_key); in d2i_ECPrivateKey()
1013 EC_PRIVATEKEY_free(priv_key); in d2i_ECPrivateKey()
1023 EC_PRIVATEKEY *priv_key = NULL; in i2d_ECPrivateKey() local
1036 priv_key->version = a->version; in i2d_ECPrivateKey()
1049 if ((priv_key->parameters = in i2d_ECPrivateKey()
[all …]
H A Dec_backend.c400 BIGNUM *priv_key = NULL; in ossl_ec_key_fromdata() local
471 if ((priv_key = BN_secure_new()) == NULL) in ossl_ec_key_fromdata()
473 if (bn_wexpand(priv_key, fixed_words) == NULL) in ossl_ec_key_fromdata()
475 BN_set_flags(priv_key, BN_FLG_CONSTTIME); in ossl_ec_key_fromdata()
477 if (!OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_ec_key_fromdata()
481 if (priv_key != NULL in ossl_ec_key_fromdata()
482 && !EC_KEY_set_private_key(ec, priv_key)) in ossl_ec_key_fromdata()
493 BN_clear_free(priv_key); in ossl_ec_key_fromdata()
636 if (src->priv_key != NULL in ossl_ec_key_dup()
641 ret->priv_key = BN_new(); in ossl_ec_key_dup()
[all …]
H A Decdsa_ossl.c145 const BIGNUM *priv_key; in ecdsa_sign_setup() local
151 if ((priv_key = EC_KEY_get0_private_key(eckey)) == NULL) { in ecdsa_sign_setup()
203 priv_key, in ecdsa_sign_setup()
209 res = ossl_bn_gen_dsa_nonce_fixed_top(k, order, priv_key, in ecdsa_sign_setup()
281 const BIGNUM *priv_key; in ossl_ecdsa_simple_sign_sig() local
284 priv_key = EC_KEY_get0_private_key(eckey); in ossl_ecdsa_simple_sign_sig()
290 if (priv_key == NULL) { in ossl_ecdsa_simple_sign_sig()
363 || !bn_mul_mont_fixed_top(s, s, priv_key, group->mont_data, ctx)) { in ossl_ecdsa_simple_sign_sig()
/openssl/providers/implementations/keymgmt/
H A Dmac_legacy_kmgmt.c59 unsigned char *priv_key; member
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()
173 || CRYPTO_memcmp(key1->priv_key, key2->priv_key, in mac_match()
195 if (key->priv_key == NULL) in mac_key_fromdata()
219 if (key->priv_key != NULL) in mac_key_fromdata()
244 if (key->priv_key != NULL in key_to_params()
429 if (gctx->priv_key == NULL) in mac_gen_set_params()
492 if (gctx->priv_key == NULL) { in mac_gen()
510 key->priv_key = gctx->priv_key; in mac_gen()
[all …]
/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()
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()
373 dh->priv_key = priv_key; in generate_key()
382 if (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.c63 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dh_key_fromdata() local
73 && !OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_dh_key_fromdata()
80 if (!DH_set0_key(dh, pub_key, priv_key)) in ossl_dh_key_fromdata()
86 BN_clear_free(priv_key); in ossl_dh_key_fromdata()
164 || !dh_bn_dup_check(&dupkey->priv_key, dh->priv_key))) in ossl_dh_dup()
H A Ddh_check.c278 int ossl_dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret) in ossl_dh_check_priv_key() argument
300 if (BN_num_bits(priv_key) <= length in ossl_dh_check_priv_key()
301 && BN_num_bits(priv_key) > 1) in ossl_dh_check_priv_key()
303 } else if (BN_num_bits(priv_key) == length) { in ossl_dh_check_priv_key()
319 if (!ossl_ffc_validate_private_key(upper, priv_key, ret)) in ossl_dh_check_priv_key()
340 || dh->priv_key == NULL in ossl_dh_check_pairwise()
352 if (!ossl_dh_generate_public_key(ctx, dh, dh->priv_key, pub_key)) in ossl_dh_check_pairwise()
H A Ddh_ameth.c199 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dh->priv_key, NULL); in dh_priv_encode()
248 BIGNUM *priv_key, *pub_key; in do_dh_print() local
251 priv_key = x->priv_key; in do_dh_print()
253 priv_key = NULL; in do_dh_print()
260 if (x->params.p == NULL || (ptype == 2 && priv_key == NULL) in do_dh_print()
278 if (!ASN1_bn_print(bp, "private-key:", priv_key, NULL, indent)) in do_dh_print()
461 const BIGNUM *priv_key = DH_get0_priv_key(dh); in dh_pkey_export_to() local
490 if (priv_key != NULL) { in dh_pkey_export_to()
492 priv_key)) in dh_pkey_export_to()
/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()
/openssl/apps/
H A Dtestdsa.h219 BIGNUM *priv_key, *pub_key, *p, *q, *g; in get_dsa() local
242 priv_key = BN_bin2bn(dsa_t.priv, dsa_t.priv_l, NULL); in get_dsa()
247 if (priv_key == NULL || pub_key == NULL || p == NULL || q == NULL in get_dsa()
259 priv_key) in get_dsa()
272 BN_free(priv_key); in get_dsa()
/openssl/demos/signature/
H A DEVP_EC_Signature_demo.c78 EVP_PKEY *priv_key = NULL; in demo_sign() local
81 priv_key = get_key(libctx, propq, public); in demo_sign()
82 if (priv_key == NULL) { in demo_sign()
100 libctx, NULL, priv_key, NULL)) { in demo_sign()
145 EVP_PKEY_free(priv_key); in demo_sign()
/openssl/demos/encrypt/
H A Drsa_encrypt.c162 EVP_PKEY *priv_key = NULL; in do_decrypt() local
166 priv_key = get_key(libctx, propq, public); in do_decrypt()
167 if (priv_key == NULL) { in do_decrypt()
171 ctx = EVP_PKEY_CTX_new_from_pkey(libctx, priv_key, propq); in do_decrypt()
208 EVP_PKEY_free(priv_key); in do_decrypt()
/openssl/test/
H A Ddhtest.c42 BIGNUM *priv_key = NULL; in dh_test() local
61 || !TEST_ptr(priv_key = BN_new())) in dh_test()
105 if (!TEST_true(BN_set_word(priv_key, 1234L)) in dh_test()
106 || !TEST_true(DH_set0_key(dh, NULL, priv_key))) in dh_test()
112 || !TEST_ptr_eq(priv_key2, priv_key)) in dh_test()
239 BN_free(priv_key); in dh_test()
586 BIGNUM *priv_key = NULL, *pub_key = NULL; in rfc5114_test() local
598 || !TEST_true(DH_set0_key(dhA, pub_key, priv_key))) in rfc5114_test()
603 || !TEST_true(DH_set0_key(dhB, pub_key, priv_key))) in rfc5114_test()
605 priv_key = pub_key = NULL; in rfc5114_test()
[all …]
/openssl/providers/implementations/encode_decode/
H A Dencode_key2text.c221 const BIGNUM *priv_key = NULL, *pub_key = NULL; in dh_to_text() local
239 priv_key = DH_get0_priv_key(dh); in dh_to_text()
240 if (priv_key == NULL) { in dh_to_text()
268 if (priv_key != NULL in dh_to_text()
297 const BIGNUM *priv_key = NULL, *pub_key = NULL; in dsa_to_text() local
314 priv_key = DSA_get0_priv_key(dsa); in dsa_to_text()
315 if (priv_key == NULL) { in dsa_to_text()
343 if (priv_key != NULL in dsa_to_text()
344 && !print_labeled_bignum(out, "priv:", priv_key)) in dsa_to_text()
520 const BIGNUM *priv_key = EC_KEY_get0_private_key(ec); in ec_to_text() local
[all …]
/openssl/crypto/pem/
H A Dpvkfmt.c401 if (!read_lebn(&p, 20, &priv_key)) in ossl_b2i_DSA_after_header()
405 BN_set_flags(priv_key, BN_FLG_CONSTTIME); in ossl_b2i_DSA_after_header()
423 if (!DSA_set0_key(dsa, pub_key, priv_key)) in ossl_b2i_DSA_after_header()
425 pub_key = priv_key = NULL; in ossl_b2i_DSA_after_header()
442 BN_free(priv_key); in ossl_b2i_DSA_after_header()
703 const BIGNUM *pub_key = NULL, *priv_key = NULL; in check_bitlen_dsa() local
706 DSA_get0_key(dsa, &pub_key, &priv_key); in check_bitlen_dsa()
716 if (BN_num_bits(priv_key) > 160) in check_bitlen_dsa()
731 const BIGNUM *pub_key = NULL, *priv_key = NULL; in write_dsa() local
734 DSA_get0_key(dsa, &pub_key, &priv_key); in write_dsa()
[all …]
/openssl/include/crypto/
H A Ddsa.h46 const BIGNUM *priv_key, BIGNUM *pub_key);
51 int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret);
H A Ddh.h25 const BIGNUM *priv_key, BIGNUM *pub_key);
44 int ossl_dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret);

Completed in 43 milliseconds

12