/openssl-master/crypto/dsa/ |
A D | dsa_key.c | 51 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in ossl_dsa_generate_public_key() 66 BIGNUM *pub_key = NULL, *priv_key = NULL; in dsa_keygen() local 71 if (dsa->priv_key == NULL) { in dsa_keygen() 72 if ((priv_key = BN_secure_new()) == NULL) in dsa_keygen() 75 priv_key = dsa->priv_key; in dsa_keygen() 90 MIN_STRENGTH, priv_key)) in dsa_keygen() 103 dsa->priv_key = priv_key; in dsa_keygen() 120 BN_clear_free(dsa->priv_key); in dsa_keygen() 122 dsa->priv_key = NULL; in dsa_keygen() 132 if (priv_key != dsa->priv_key) in dsa_keygen() [all …]
|
A D | dsa_lib.c | 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() 80 BN_free(priv_key); in DSA_dup_DH() 235 BN_clear_free(r->priv_key); in DSA_free() 300 return d->priv_key; in DSA_get0_priv_key() 308 if (priv_key != NULL) in DSA_get0_key() 309 *priv_key = d->priv_key; in DSA_get0_key() 318 if (priv_key != NULL) { in DSA_set0_key() 319 BN_free(d->priv_key); in DSA_set0_key() [all …]
|
A D | dsa_backend.c | 33 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dsa_key_fromdata() local 49 if (param_priv_key != NULL && !OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_dsa_key_fromdata() 52 if (!DSA_set0_key(dsa, pub_key, priv_key)) in ossl_dsa_key_fromdata() 58 BN_clear_free(priv_key); in ossl_dsa_key_fromdata() 103 || !dsa_bn_dup_check(&dupkey->priv_key, dsa->priv_key))) in ossl_dsa_dup()
|
A D | dsa_check.c | 55 int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret) in ossl_dsa_check_priv_key() argument 60 && ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret)); in ossl_dsa_check_priv_key() 75 || dsa->priv_key == NULL in ossl_dsa_check_pairwise() 87 if (!ossl_dsa_generate_public_key(ctx, dsa, dsa->priv_key, pub_key)) in ossl_dsa_check_pairwise()
|
A D | dsa_ameth.c | 170 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() 273 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local 280 priv_key = x->priv_key; in do_dsa_print() 282 priv_key = NULL; in do_dsa_print() 296 if (priv_key != NULL) { in do_dsa_print() 306 if (!ASN1_bn_print(bp, "priv:", priv_key, NULL, off)) in do_dsa_print() 434 const BIGNUM *priv_key = DSA_get0_priv_key(dsa); in dsa_pkey_export_to() local 457 if (priv_key != NULL) { in dsa_pkey_export_to() 459 priv_key)) in dsa_pkey_export_to()
|
/openssl-master/crypto/ec/ |
A D | ec_key.c | 99 BN_clear_free(r->priv_key); in EC_KEY_free() 150 if (!BN_copy(dest->priv_key, src->priv_key)) in EC_KEY_copy() 254 BIGNUM *priv_key = NULL; in ec_generate_key() local 267 if (priv_key == NULL) in ec_generate_key() 270 priv_key = eckey->priv_key; in ec_generate_key() 318 eckey->priv_key = priv_key; in ec_generate_key() 320 priv_key = NULL; in ec_generate_key() 347 BN_clear_free(priv_key); in ec_generate_key() 692 return key->priv_key; in EC_KEY_get0_private_key() 774 key->priv_key = tmp_key; in EC_KEY_set_private_key() [all …]
|
A D | ecdh_ossl.c | 55 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() 84 !BN_mul(x, x, priv_key, ctx)) { in ossl_ecdh_simple_compute_key() 88 priv_key = x; in ossl_ecdh_simple_compute_key() 96 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { in ossl_ecdh_simple_compute_key()
|
A D | ec_asn1.c | 930 EC_PRIVATEKEY *priv_key = NULL; in d2i_ECPrivateKey() local 944 if (priv_key->parameters) { in d2i_ECPrivateKey() 957 ret->version = priv_key->version; in d2i_ECPrivateKey() 959 if (priv_key->privateKey) { in d2i_ECPrivateKey() 979 if (priv_key->publicKey) { in d2i_ECPrivateKey() 999 EC_PRIVATEKEY_free(priv_key); in d2i_ECPrivateKey() 1007 EC_PRIVATEKEY_free(priv_key); in d2i_ECPrivateKey() 1017 EC_PRIVATEKEY *priv_key = NULL; in i2d_ECPrivateKey() local 1030 priv_key->version = a->version; in i2d_ECPrivateKey() 1043 if ((priv_key->parameters = in i2d_ECPrivateKey() [all …]
|
A D | ec_backend.c | 395 BIGNUM *priv_key = NULL; in ossl_ec_key_fromdata() local 466 if ((priv_key = BN_secure_new()) == NULL) in ossl_ec_key_fromdata() 468 if (bn_wexpand(priv_key, fixed_words) == NULL) in ossl_ec_key_fromdata() 470 BN_set_flags(priv_key, BN_FLG_CONSTTIME); in ossl_ec_key_fromdata() 472 if (!OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_ec_key_fromdata() 476 if (priv_key != NULL in ossl_ec_key_fromdata() 477 && !EC_KEY_set_private_key(ec, priv_key)) in ossl_ec_key_fromdata() 488 BN_clear_free(priv_key); in ossl_ec_key_fromdata() 637 if (src->priv_key != NULL in ossl_ec_key_dup() 642 ret->priv_key = BN_new(); in ossl_ec_key_dup() [all …]
|
A D | ecdsa_ossl.c | 85 const BIGNUM *priv_key; in ecdsa_sign_setup() local 91 if ((priv_key = EC_KEY_get0_private_key(eckey)) == NULL) { in ecdsa_sign_setup() 132 if (!BN_generate_dsa_nonce(k, order, priv_key, in ecdsa_sign_setup() 203 const BIGNUM *priv_key; in ossl_ecdsa_simple_sign_sig() local 206 priv_key = EC_KEY_get0_private_key(eckey); in ossl_ecdsa_simple_sign_sig() 212 if (priv_key == NULL) { in ossl_ecdsa_simple_sign_sig() 280 || !bn_mul_mont_fixed_top(s, s, priv_key, group->mont_data, ctx)) { in ossl_ecdsa_simple_sign_sig()
|
/openssl-master/providers/implementations/keymgmt/ |
A D | mac_legacy_kmgmt.c | 60 unsigned char *priv_key; member 168 if ((key1->priv_key == NULL && key2->priv_key != NULL) in mac_match() 169 || (key1->priv_key != NULL && key2->priv_key == NULL) in mac_match() 176 || CRYPTO_memcmp(key1->priv_key, key2->priv_key, in mac_match() 198 if (key->priv_key == NULL) { in mac_key_fromdata() 226 if (key->priv_key != NULL) in mac_key_fromdata() 251 if (key->priv_key != NULL in key_to_params() 433 if (gctx->priv_key == NULL) { in mac_gen_set_params() 498 if (gctx->priv_key == NULL) { in mac_gen() 516 key->priv_key = gctx->priv_key; in mac_gen() [all …]
|
/openssl-master/crypto/dh/ |
A D | dh_key.c | 66 if (dh->priv_key == NULL) { in ossl_dh_compute_key() 74 BN_set_flags(dh->priv_key, BN_FLG_CONSTTIME); in ossl_dh_compute_key() 244 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in ossl_dh_generate_public_key() 264 BIGNUM *pub_key = NULL, *priv_key = NULL; in generate_key() local 280 if (dh->priv_key == NULL) { in generate_key() 281 priv_key = BN_secure_new(); in generate_key() 282 if (priv_key == NULL) in generate_key() 286 priv_key = dh->priv_key; in generate_key() 358 dh->priv_key = priv_key; in generate_key() 367 if (priv_key != dh->priv_key) in generate_key() [all …]
|
A D | dh_lib.c | 157 BN_clear_free(r->priv_key); in DH_free() 253 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument 257 if (priv_key != NULL) in DH_get0_key() 258 *priv_key = dh->priv_key; in DH_get0_key() 261 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument 267 if (priv_key != NULL) { in DH_set0_key() 268 BN_clear_free(dh->priv_key); in DH_set0_key() 269 dh->priv_key = priv_key; in DH_set0_key() 293 return dh->priv_key; in DH_get0_priv_key()
|
A D | dh_backend.c | 69 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dh_key_fromdata() local 78 && !OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_dh_key_fromdata() 83 if (!DH_set0_key(dh, pub_key, priv_key)) in ossl_dh_key_fromdata() 89 BN_clear_free(priv_key); in ossl_dh_key_fromdata() 165 || !dh_bn_dup_check(&dupkey->priv_key, dh->priv_key))) in ossl_dh_dup()
|
A D | dh_ameth.c | 199 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dh->priv_key, NULL); in dh_priv_encode() 245 BIGNUM *priv_key, *pub_key; in do_dh_print() local 248 priv_key = x->priv_key; in do_dh_print() 250 priv_key = NULL; in do_dh_print() 257 if (x->params.p == NULL || (ptype == 2 && priv_key == NULL) in do_dh_print() 275 if (!ASN1_bn_print(bp, "private-key:", priv_key, NULL, indent)) in do_dh_print() 451 const BIGNUM *priv_key = DH_get0_priv_key(dh); in dh_pkey_export_to() local 480 if (priv_key != NULL) { in dh_pkey_export_to() 482 priv_key)) in dh_pkey_export_to()
|
A D | dh_check.c | 251 int ossl_dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret) in ossl_dh_check_priv_key() argument 271 if (!ossl_ffc_validate_private_key(upper, priv_key, ret)) in ossl_dh_check_priv_key() 292 || dh->priv_key == NULL in ossl_dh_check_pairwise() 304 if (!ossl_dh_generate_public_key(ctx, dh, dh->priv_key, pub_key)) in ossl_dh_check_pairwise()
|
/openssl-master/crypto/sm2/ |
A D | sm2_key.c | 27 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-master/apps/ |
A D | testdsa.h | 219 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-master/test/ |
A D | dhtest.c | 42 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() 216 BN_free(priv_key); in dh_test() 563 BIGNUM *priv_key = NULL, *pub_key = NULL; in rfc5114_test() local 575 || !TEST_true(DH_set0_key(dhA, pub_key, priv_key))) in rfc5114_test() 580 || !TEST_true(DH_set0_key(dhB, pub_key, priv_key))) in rfc5114_test() 582 priv_key = pub_key = NULL; in rfc5114_test() [all …]
|
/openssl-master/demos/signature/ |
A D | EVP_Signature_demo.c | 78 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-master/providers/implementations/encode_decode/ |
A D | encode_key2text.c | 217 const BIGNUM *priv_key = NULL, *pub_key = NULL; in dh_to_text() local 234 priv_key = DH_get0_priv_key(dh); in dh_to_text() 235 if (priv_key == NULL) { in dh_to_text() 263 if (priv_key != NULL in dh_to_text() 287 const BIGNUM *priv_key = NULL, *pub_key = NULL; in dsa_to_text() local 304 priv_key = DSA_get0_priv_key(dsa); in dsa_to_text() 305 if (priv_key == NULL) { in dsa_to_text() 333 if (priv_key != NULL in dsa_to_text() 334 && !print_labeled_bignum(out, "priv:", priv_key)) in dsa_to_text() 509 const BIGNUM *priv_key = EC_KEY_get0_private_key(ec); in ec_to_text() local [all …]
|
/openssl-master/include/crypto/ |
A D | dsa.h | 38 const BIGNUM *priv_key, BIGNUM *pub_key); 43 int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret);
|
A D | dh.h | 25 const BIGNUM *priv_key, BIGNUM *pub_key); 43 int ossl_dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret);
|
/openssl-master/crypto/pem/ |
A D | pvkfmt.c | 401 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() 437 BN_free(priv_key); in ossl_b2i_DSA_after_header() 693 const BIGNUM *pub_key = NULL, *priv_key = NULL; in check_bitlen_dsa() local 696 DSA_get0_key(dsa, &pub_key, &priv_key); in check_bitlen_dsa() 706 if (BN_num_bits(priv_key) > 160) in check_bitlen_dsa() 721 const BIGNUM *pub_key = NULL, *priv_key = NULL; in write_dsa() local 724 DSA_get0_key(dsa, &pub_key, &priv_key); in write_dsa() [all …]
|
/openssl-master/doc/man3/ |
A D | DSA_get0_pqg.pod | 24 const BIGNUM **pub_key, const BIGNUM **priv_key); 25 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key); 42 public key (B<pub_key>) and (optionally) a private key (B<priv_key>). 58 private key will be stored in B<*priv_key>. Either may be NULL if they have not 71 Any of the values B<p>, B<q>, B<g>, B<priv_key>, and B<pub_key> can also be
|