Home
last modified time | relevance | path

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

123

/third_party/openssl/crypto/dsa/
Ddsa_key.c29 BIGNUM *pub_key = NULL, *priv_key = NULL; in dsa_builtin_keygen() local
34 if (dsa->priv_key == NULL) { in dsa_builtin_keygen()
35 if ((priv_key = BN_secure_new()) == NULL) in dsa_builtin_keygen()
38 priv_key = dsa->priv_key; in dsa_builtin_keygen()
41 if (!BN_priv_rand_range(priv_key, dsa->q)) in dsa_builtin_keygen()
43 while (BN_is_zero(priv_key)) ; in dsa_builtin_keygen()
56 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in dsa_builtin_keygen()
66 dsa->priv_key = priv_key; in dsa_builtin_keygen()
73 if (priv_key != dsa->priv_key) in dsa_builtin_keygen()
74 BN_free(priv_key); in dsa_builtin_keygen()
Ddsa_lib.c130 BN_clear_free(r->priv_key); in DSA_free()
194 BIGNUM *p = NULL, *q = NULL, *g = NULL, *pub_key = NULL, *priv_key = NULL; in DSA_dup_DH() local
218 if (r->priv_key != NULL) { in DSA_dup_DH()
219 priv_key = BN_dup(r->priv_key); in DSA_dup_DH()
220 if (priv_key == NULL) in DSA_dup_DH()
223 if (!DH_set0_key(ret, pub_key, priv_key)) in DSA_dup_DH()
225 } else if (r->priv_key != NULL) { in DSA_dup_DH()
237 BN_free(priv_key); in DSA_dup_DH()
281 const BIGNUM **pub_key, const BIGNUM **priv_key) in DSA_get0_key() argument
285 if (priv_key != NULL) in DSA_get0_key()
[all …]
Ddsa_ameth.c167 if ((dsa->priv_key = BN_secure_new()) == NULL in dsa_priv_decode()
168 || !ASN1_INTEGER_to_BN(privkey, dsa->priv_key)) { in dsa_priv_decode()
182 BN_set_flags(dsa->priv_key, BN_FLG_CONSTTIME); in dsa_priv_decode()
183 if (!BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) { in dsa_priv_decode()
210 if (!pkey->pkey.dsa || !pkey->pkey.dsa->priv_key) { in dsa_priv_encode()
230 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dsa->priv_key, NULL); in dsa_priv_encode()
333 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local
336 priv_key = x->priv_key; in do_dsa_print()
338 priv_key = NULL; in do_dsa_print()
352 if (priv_key) { in do_dsa_print()
[all …]
/third_party/openssl/crypto/dh/
Ddh_key.c110 BIGNUM *pub_key = NULL, *priv_key = NULL; in generate_key() local
121 if (dh->priv_key == NULL) { in generate_key()
122 priv_key = BN_secure_new(); in generate_key()
123 if (priv_key == NULL) in generate_key()
127 priv_key = dh->priv_key; in generate_key()
146 if (!BN_priv_rand_range(priv_key, dh->q)) in generate_key()
149 while (BN_is_zero(priv_key) || BN_is_one(priv_key)); in generate_key()
153 if (!BN_priv_rand(priv_key, l, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) in generate_key()
161 if (!BN_clear_bit(priv_key, 0)) in generate_key()
172 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in generate_key()
[all …]
Ddh_lib.c126 BN_clear_free(r->priv_key); in DH_free()
226 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
230 if (priv_key != NULL) in DH_get0_key()
231 *priv_key = dh->priv_key; in DH_get0_key()
234 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
240 if (priv_key != NULL) { in DH_set0_key()
241 BN_clear_free(dh->priv_key); in DH_set0_key()
242 dh->priv_key = priv_key; in DH_set0_key()
265 return dh->priv_key; in DH_get0_priv_key()
/third_party/openssl/crypto/ec/
Dec_key.c69 BN_clear_free(r->priv_key); in EC_KEY_free()
112 if (src->priv_key != NULL) { in EC_KEY_copy()
113 if (dest->priv_key == NULL) { in EC_KEY_copy()
114 dest->priv_key = BN_new(); in EC_KEY_copy()
115 if (dest->priv_key == NULL) in EC_KEY_copy()
118 if (!BN_copy(dest->priv_key, src->priv_key)) in EC_KEY_copy()
203 BIGNUM *priv_key = NULL; in ec_key_simple_generate_key() local
210 if (eckey->priv_key == NULL) { in ec_key_simple_generate_key()
211 priv_key = BN_new(); in ec_key_simple_generate_key()
212 if (priv_key == NULL) in ec_key_simple_generate_key()
[all …]
Decdh_ossl.c44 const BIGNUM *priv_key; in ecdh_simple_compute_key() local
59 priv_key = EC_KEY_get0_private_key(ecdh); in ecdh_simple_compute_key()
60 if (priv_key == NULL) { in ecdh_simple_compute_key()
69 !BN_mul(x, x, priv_key, ctx)) { in ecdh_simple_compute_key()
73 priv_key = x; in ecdh_simple_compute_key()
81 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { in ecdh_simple_compute_key()
Dec_asn1.c997 EC_PRIVATEKEY *priv_key = NULL; in d2i_ECPrivateKey() local
1000 if ((priv_key = d2i_EC_PRIVATEKEY(NULL, &p, len)) == NULL) { in d2i_ECPrivateKey()
1013 if (priv_key->parameters) { in d2i_ECPrivateKey()
1015 ret->group = EC_GROUP_new_from_ecpkparameters(priv_key->parameters); in d2i_ECPrivateKey()
1017 && priv_key->parameters->type == ECPKPARAMETERS_TYPE_EXPLICIT) in d2i_ECPrivateKey()
1026 ret->version = priv_key->version; in d2i_ECPrivateKey()
1028 if (priv_key->privateKey) { in d2i_ECPrivateKey()
1029 ASN1_OCTET_STRING *pkey = priv_key->privateKey; in d2i_ECPrivateKey()
1045 if (priv_key->publicKey) { in d2i_ECPrivateKey()
1049 pub_oct = ASN1_STRING_get0_data(priv_key->publicKey); in d2i_ECPrivateKey()
[all …]
Decdsa_ossl.c44 const BIGNUM *priv_key; in ecdsa_sign_setup() local
50 if ((priv_key = EC_KEY_get0_private_key(eckey)) == NULL) { in ecdsa_sign_setup()
91 if (!BN_generate_dsa_nonce(k, order, priv_key, in ecdsa_sign_setup()
164 const BIGNUM *priv_key; in ossl_ecdsa_sign_sig() local
167 priv_key = EC_KEY_get0_private_key(eckey); in ossl_ecdsa_sign_sig()
173 if (priv_key == NULL) { in ossl_ecdsa_sign_sig()
241 || !bn_mul_mont_fixed_top(s, s, priv_key, group->mont_data, ctx)) { in ossl_ecdsa_sign_sig()
/third_party/boringssl/src/crypto/dh/
Ddh.c111 BN_clear_free(dh->priv_key); in DH_free()
123 *out_priv_key = dh->priv_key; in DH_get0_key()
127 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) { in DH_set0_key() argument
133 if (priv_key != NULL) { in DH_set0_key()
134 BN_free(dh->priv_key); in DH_set0_key()
135 dh->priv_key = priv_key; in DH_set0_key()
296 BIGNUM *pub_key = NULL, *priv_key = NULL; in DH_generate_key() local
308 if (dh->priv_key == NULL) { in DH_generate_key()
309 priv_key = BN_new(); in DH_generate_key()
310 if (priv_key == NULL) { in DH_generate_key()
[all …]
/third_party/boringssl/src/crypto/fipsmodule/ec/
Dec_key.c173 ec_wrapped_scalar_free(r->priv_key); in EC_KEY_free()
196 (src->priv_key != NULL && in EC_KEY_dup()
228 assert(key->priv_key == NULL); in EC_KEY_set_group()
237 return key->priv_key != NULL ? &key->priv_key->bignum : NULL; in EC_KEY_get0_private_key()
240 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv_key) { in EC_KEY_set_private_key() argument
250 if (!ec_bignum_to_scalar(key->group, &scalar->scalar, priv_key)) { in EC_KEY_set_private_key()
255 ec_wrapped_scalar_free(key->priv_key); in EC_KEY_set_private_key()
256 key->priv_key = scalar; in EC_KEY_set_private_key()
322 if (eckey->priv_key != NULL) { in EC_KEY_check_key()
326 &eckey->priv_key->scalar)) { in EC_KEY_check_key()
[all …]
/third_party/boringssl/src/crypto/fipsmodule/ecdh/
Decdh.c81 const EC_KEY *priv_key) { in ECDH_compute_key_fips() argument
82 if (priv_key->priv_key == NULL) { in ECDH_compute_key_fips()
86 const EC_SCALAR *const priv = &priv_key->priv_key->scalar; in ECDH_compute_key_fips()
87 const EC_GROUP *const group = EC_KEY_get0_group(priv_key); in ECDH_compute_key_fips()
/third_party/boringssl/src/crypto/ecdh_extra/
Decdh_extra.c81 const EC_KEY *priv_key, in ECDH_compute_key() argument
84 if (priv_key->priv_key == NULL) { in ECDH_compute_key()
88 const EC_SCALAR *const priv = &priv_key->priv_key->scalar; in ECDH_compute_key()
89 const EC_GROUP *const group = EC_KEY_get0_group(priv_key); in ECDH_compute_key()
/third_party/mbedtls/library/
Dpkcs11.c123 int mbedtls_pkcs11_priv_key_bind( mbedtls_pkcs11_context *priv_key, in mbedtls_pkcs11_priv_key_bind() argument
131 if( priv_key == NULL ) in mbedtls_pkcs11_priv_key_bind()
137 priv_key->len = mbedtls_pk_get_len( &cert.pk ); in mbedtls_pkcs11_priv_key_bind()
138 priv_key->pkcs11h_cert = pkcs11_cert; in mbedtls_pkcs11_priv_key_bind()
148 void mbedtls_pkcs11_priv_key_free( mbedtls_pkcs11_context *priv_key ) in mbedtls_pkcs11_priv_key_free() argument
150 if( NULL != priv_key ) in mbedtls_pkcs11_priv_key_free()
151 pkcs11h_certificate_freeCertificate( priv_key->pkcs11h_cert ); in mbedtls_pkcs11_priv_key_free()
/third_party/boringssl/src/crypto/evp/
Dprint.c223 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local
225 priv_key = NULL; in do_dsa_print()
227 priv_key = x->priv_key; in do_dsa_print()
245 update_buflen(priv_key, &buf_len); in do_dsa_print()
254 if (priv_key) { in do_dsa_print()
261 if (!bn_print(bp, "priv:", priv_key, m, off) || in do_dsa_print()
302 const BIGNUM *priv_key; in do_EC_KEY_print() local
343 priv_key = EC_KEY_get0_private_key(x); in do_EC_KEY_print()
344 if (priv_key && (i = (size_t)BN_num_bytes(priv_key)) > buf_len) { in do_EC_KEY_print()
348 priv_key = NULL; in do_EC_KEY_print()
[all …]
Dp_dsa_asn1.c138 dsa->priv_key = BN_new(); in dsa_priv_decode()
140 if (dsa->priv_key == NULL || dsa->pub_key == NULL) { in dsa_priv_decode()
145 if (!BN_parse_asn1_unsigned(key, dsa->priv_key) || in dsa_priv_decode()
154 !BN_mod_exp_mont_consttime(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, in dsa_priv_decode()
171 if (dsa == NULL || dsa->priv_key == NULL) { in dsa_priv_encode()
185 !BN_marshal_asn1(&private_key, dsa->priv_key) || in dsa_priv_encode()
/third_party/openssl/test/
Ddhtest.c33 BIGNUM *priv_key = NULL; in dh_test() local
52 || !TEST_ptr(priv_key = BN_new())) in dh_test()
91 if (!TEST_true(BN_set_word(priv_key, 1234L)) in dh_test()
92 || !TEST_true(DH_set0_key(dh, NULL, priv_key))) in dh_test()
98 || !TEST_ptr_eq(priv_key2, priv_key)) in dh_test()
115 || !TEST_ptr_eq(priv_key2, priv_key)) in dh_test()
210 BN_free(priv_key); in dh_test()
523 BIGNUM *bady = NULL, *priv_key = NULL, *pub_key = NULL; in rfc5114_test() local
533 if (!TEST_ptr(priv_key = BN_bin2bn(td->xA, td->xA_len, NULL)) in rfc5114_test()
535 || !TEST_true(DH_set0_key(dhA, pub_key, priv_key))) in rfc5114_test()
[all …]
/third_party/boringssl/src/crypto/dsa/
Ddsa.c122 BN_clear_free(dsa->priv_key); in DSA_free()
140 *out_priv_key = dsa->priv_key; in DSA_get0_key()
157 int DSA_set0_key(DSA *dsa, BIGNUM *pub_key, BIGNUM *priv_key) { in DSA_set0_key() argument
166 if (priv_key != NULL) { in DSA_set0_key()
167 BN_free(dsa->priv_key); in DSA_set0_key()
168 dsa->priv_key = priv_key; in DSA_set0_key()
473 BIGNUM *pub_key = NULL, *priv_key = NULL; in DSA_generate_key() local
480 priv_key = dsa->priv_key; in DSA_generate_key()
481 if (priv_key == NULL) { in DSA_generate_key()
482 priv_key = BN_new(); in DSA_generate_key()
[all …]
/third_party/openssl/apps/
Dtestdsa.h217 BIGNUM *priv_key, *pub_key, *p, *q, *g; in get_dsa() local
236 priv_key = BN_bin2bn(dsa_t.priv, dsa_t.priv_l, NULL); in get_dsa()
241 if ((priv_key == NULL) || (pub_key == NULL) || (p == NULL) || (q == NULL) in get_dsa()
248 if (!DSA_set0_key(dsa, pub_key, priv_key)) in get_dsa()
254 BN_free(priv_key); in get_dsa()
/third_party/boringssl/src/crypto/fipsmodule/ecdsa/
Decdsa.c192 size_t digest_len, const EC_SCALAR *priv_key) { in ecdsa_sign_setup() argument
219 SHA512_Update(&sha, priv_key->words, order->width * sizeof(BN_ULONG)); in ecdsa_sign_setup()
256 if (group == NULL || eckey->priv_key == NULL) { in ECDSA_do_sign()
261 const EC_SCALAR *priv_key = &eckey->priv_key->scalar; in ECDSA_do_sign() local
274 priv_key) || in ECDSA_do_sign()
283 ec_scalar_mul_montgomery(group, &s, priv_key, &r_mont); in ECDSA_do_sign()
/third_party/libcoap/src/
Dcoap_tinydtls.c34 coap_binary_t *priv_key; member
352 ecdsa_key.priv_key = t_context->priv_key->s; in get_ecdsa_key()
461 if (t_context->priv_key) { in coap_dtls_free_context()
462 coap_delete_binary(t_context->priv_key); in coap_dtls_free_context()
463 t_context->priv_key = NULL; in coap_dtls_free_context()
885 t_context->priv_key = get_asn1_tag(COAP_ASN1_OCTETSTRING, priv_data, in asn1_derive_keys()
887 if (!t_context->priv_key) { in asn1_derive_keys()
892 if (t_context->priv_key->length - 1 == DTLS_EC_KEY_SIZE && in asn1_derive_keys()
893 t_context->priv_key->s[0] == '\000') { in asn1_derive_keys()
894 t_context->priv_key->length--; in asn1_derive_keys()
[all …]
/third_party/boringssl/src/include/openssl/
Decdh.h89 void *out, size_t outlen, const EC_POINT *pub_key, const EC_KEY *priv_key,
106 const EC_KEY *priv_key);
/third_party/openssl/crypto/pem/
Dpvkfmt.c252 BIGNUM *pbn = NULL, *qbn = NULL, *gbn = NULL, *priv_key = NULL; in b2i_dss() local
274 if (!read_lebn(&p, 20, &priv_key)) in b2i_dss()
278 BN_set_flags(priv_key, BN_FLG_CONSTTIME); in b2i_dss()
287 if (!BN_mod_exp(pub_key, gbn, priv_key, pbn, ctx)) in b2i_dss()
296 if (!DSA_set0_key(dsa, pub_key, priv_key)) in b2i_dss()
298 pub_key = priv_key = NULL; in b2i_dss()
313 BN_free(priv_key); in b2i_dss()
494 const BIGNUM *pub_key = NULL, *priv_key = NULL; in check_bitlen_dsa() local
497 DSA_get0_key(dsa, &pub_key, &priv_key); in check_bitlen_dsa()
507 if (BN_num_bits(priv_key) > 160) in check_bitlen_dsa()
[all …]
/third_party/ffmpeg/libavformat/
Dlibssh.c41 char *priv_key; member
86 if (libssh->priv_key) { in libssh_authentication()
88 ssh_private_key priv_key; in libssh_authentication() local
90 if (!ssh_try_publickey_from_file(libssh->session, libssh->priv_key, &pub_key, &type)) { in libssh_authentication()
91 priv_key = privatekey_from_file(libssh->session, libssh->priv_key, type, password); in libssh_authentication()
92 … if (ssh_userauth_pubkey(libssh->session, NULL, pub_key, priv_key) == SSH_AUTH_SUCCESS) { in libssh_authentication()
481 …{"private_key", "set path to private key", OFFSET(priv_key), AV_OPT_TYPE_STRING, { .str = NULL }, …
Drtmpdh.c231 bn_new(dh->priv_key); in dh_generate_key()
232 if (!dh->priv_key) in dh_generate_key()
234 bn_random(dh->priv_key, 8 * num_bytes); in dh_generate_key()
238 bn_free(dh->priv_key); in dh_generate_key()
242 if (bn_modexp(dh->pub_key, dh->g, dh->priv_key, dh->p) < 0) in dh_generate_key()
258 if ((ret = bn_modexp(k, pub_key_bn, dh->priv_key, dh->p)) < 0) { in dh_compute_key()
276 bn_free(dh->priv_key); in ff_dh_free()

123