Home
last modified time | relevance | path

Searched refs:pub_key (Results 1 – 25 of 52) sorted by relevance

123

/third_party/openssl/crypto/dsa/
Ddsa_key.c29 BIGNUM *pub_key = NULL, *priv_key = NULL; in dsa_builtin_keygen() local
45 if (dsa->pub_key == NULL) { in dsa_builtin_keygen()
46 if ((pub_key = BN_new()) == NULL) in dsa_builtin_keygen()
49 pub_key = dsa->pub_key; in dsa_builtin_keygen()
58 if (!BN_mod_exp(pub_key, dsa->g, prk, dsa->p, ctx)) { in dsa_builtin_keygen()
67 dsa->pub_key = pub_key; in dsa_builtin_keygen()
71 if (pub_key != dsa->pub_key) in dsa_builtin_keygen()
72 BN_free(pub_key); in dsa_builtin_keygen()
Ddsa_lib.c129 BN_clear_free(r->pub_key); in DSA_free()
194 BIGNUM *p = NULL, *q = NULL, *g = NULL, *pub_key = NULL, *priv_key = NULL; in DSA_dup_DH() local
214 if (r->pub_key != NULL) { in DSA_dup_DH()
215 pub_key = BN_dup(r->pub_key); in DSA_dup_DH()
216 if (pub_key == NULL) in DSA_dup_DH()
223 if (!DH_set0_key(ret, pub_key, priv_key)) in DSA_dup_DH()
236 BN_free(pub_key); in DSA_dup_DH()
281 const BIGNUM **pub_key, const BIGNUM **priv_key) in DSA_get0_key() argument
283 if (pub_key != NULL) in DSA_get0_key()
284 *pub_key = d->pub_key; in DSA_get0_key()
[all …]
Ddsa_ameth.c61 if ((dsa->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) { in dsa_pub_decode()
103 pubint = BN_to_ASN1_INTEGER(dsa->pub_key, NULL); in dsa_pub_encode()
173 if ((dsa->pub_key = BN_new()) == NULL) { in dsa_priv_decode()
183 if (!BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) { in dsa_priv_decode()
318 if (BN_cmp(b->pkey.dsa->pub_key, a->pkey.dsa->pub_key) != 0) in dsa_pub_cmp()
333 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local
341 pub_key = x->pub_key; in do_dsa_print()
343 pub_key = NULL; in do_dsa_print()
362 if (!ASN1_bn_print(bp, "pub: ", pub_key, NULL, off)) in do_dsa_print()
/third_party/openssl/crypto/dh/
Ddh_key.c16 static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
32 int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) in DH_compute_key() argument
38 if ((ret = dh->meth->compute_key(key, pub_key, dh)) <= 0) in DH_compute_key()
57 int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh) in DH_compute_key_padded() argument
62 rv = dh->meth->compute_key(key, pub_key, dh); in DH_compute_key_padded()
110 BIGNUM *pub_key = NULL, *priv_key = NULL; in generate_key() local
129 if (dh->pub_key == NULL) { in generate_key()
130 pub_key = BN_new(); in generate_key()
131 if (pub_key == NULL) in generate_key()
134 pub_key = dh->pub_key; in generate_key()
[all …]
Ddh_lib.c125 BN_clear_free(r->pub_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
228 if (pub_key != NULL) in DH_get0_key()
229 *pub_key = dh->pub_key; in DH_get0_key()
234 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
236 if (pub_key != NULL) { in DH_set0_key()
237 BN_clear_free(dh->pub_key); in DH_set0_key()
238 dh->pub_key = pub_key; in DH_set0_key()
270 return dh->pub_key; in DH_get0_pub_key()
Ddh_ameth.c81 if ((dh->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) { in dh_pub_decode()
104 ASN1_INTEGER *pub_key = NULL; in dh_pub_encode() local
120 pub_key = BN_to_ASN1_INTEGER(dh->pub_key, NULL); in dh_pub_encode()
121 if (!pub_key) in dh_pub_encode()
124 penclen = i2d_ASN1_INTEGER(pub_key, &penc); in dh_pub_encode()
126 ASN1_INTEGER_free(pub_key); in dh_pub_encode()
271 BIGNUM *priv_key, *pub_key; in do_dh_print() local
279 pub_key = x->pub_key; in do_dh_print()
281 pub_key = NULL; in do_dh_print()
284 || (ptype > 0 && pub_key == NULL)) { in do_dh_print()
[all …]
Ddh_check.c176 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key) in DH_check_pub_key_ex() argument
180 if (!DH_check_pub_key(dh, pub_key, &errflags)) in DH_check_pub_key_ex()
193 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret) in DH_check_pub_key() argument
207 if (BN_cmp(pub_key, tmp) <= 0) in DH_check_pub_key()
211 if (BN_cmp(pub_key, tmp) >= 0) in DH_check_pub_key()
216 if (!BN_mod_exp(tmp, pub_key, dh->q, dh->p, ctx)) in DH_check_pub_key()
Ddh_local.h23 BIGNUM *pub_key; /* g^x % p */ member
44 int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh);
/third_party/openssl/crypto/ec/
Dec_key.c68 EC_POINT_free(r->pub_key); in EC_KEY_free()
103 if (src->pub_key != NULL) { in EC_KEY_copy()
104 EC_POINT_free(dest->pub_key); in EC_KEY_copy()
105 dest->pub_key = EC_POINT_new(src->group); in EC_KEY_copy()
106 if (dest->pub_key == NULL) in EC_KEY_copy()
108 if (!EC_POINT_copy(dest->pub_key, src->pub_key)) in EC_KEY_copy()
205 EC_POINT *pub_key = NULL; in ec_key_simple_generate_key() local
226 if (eckey->pub_key == NULL) { in ec_key_simple_generate_key()
227 pub_key = EC_POINT_new(eckey->group); in ec_key_simple_generate_key()
228 if (pub_key == NULL) in ec_key_simple_generate_key()
[all …]
Decdh_ossl.c23 const EC_POINT *pub_key, const EC_KEY *ecdh) in ossl_ecdh_compute_key() argument
30 return ecdh->group->meth->ecdh_compute_key(psec, pseclen, pub_key, ecdh); in ossl_ecdh_compute_key()
39 const EC_POINT *pub_key, const EC_KEY *ecdh) in ecdh_simple_compute_key() argument
81 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { in ecdh_simple_compute_key()
Dec_kmeth.c127 int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, in ECDH_compute_key() argument
142 if (!eckey->meth->compute_key(&sec, &seclen, pub_key, eckey)) in ECDH_compute_key()
181 const EC_POINT *pub_key)) in EC_KEY_METHOD_set_init() argument
200 const EC_POINT *pub_key, in EC_KEY_METHOD_set_compute_key() argument
248 const EC_POINT *pub_key)) in EC_KEY_METHOD_get_init() argument
274 const EC_POINT *pub_key, in EC_KEY_METHOD_get_compute_key() argument
/third_party/openssl/util/perl/TLSProxy/
DServerKeyExchange.pm35 $self->{pub_key} = "";
65 my $pub_key = substr($self->data, $ptr, $pub_key_len);
88 $self->pub_key($pub_key);
104 $data .= pack('n', length($self->pub_key));
105 $data .= $self->pub_key;
133 sub pub_key subroutine
137 $self->{pub_key} = shift;
139 return $self->{pub_key};
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/wpa_supplicant_lib/
Dwpa_evp_key.c129 EVP_PKEY *pub_key = NULL; in GET_EVP_PKEY() local
135 pub_key = get_pubkey(key_id); in GET_EVP_PKEY()
136 if (pub_key == NULL) { in GET_EVP_PKEY()
141 key_type = EVP_PKEY_type(pub_key->type); in GET_EVP_PKEY()
144 EVP_PKEY_free(pub_key); in GET_EVP_PKEY()
148 public_rsa = EVP_PKEY_get0_RSA(pub_key); in GET_EVP_PKEY()
151 EVP_PKEY_free(pub_key); in GET_EVP_PKEY()
156 EVP_PKEY_free(pub_key); in GET_EVP_PKEY()
/third_party/ffmpeg/libavformat/
Drtmpdh.c236 bn_new(dh->pub_key); in dh_generate_key()
237 if (!dh->pub_key) { in dh_generate_key()
242 if (bn_modexp(dh->pub_key, dh->g, dh->priv_key, dh->p) < 0) in dh_generate_key()
245 return dh->pub_key; in dh_generate_key()
275 bn_free(dh->pub_key); in ff_dh_free()
362 ret = dh_is_valid_public_key(dh->pub_key, dh->p, q1); in ff_dh_generate_public_key()
374 int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len) in ff_dh_write_public_key() argument
379 len = bn_num_bytes(dh->pub_key); in ff_dh_write_public_key()
384 memset(pub_key, 0, pub_key_len); in ff_dh_write_public_key()
385 bn_bn2bin(dh->pub_key, pub_key + pub_key_len - len, len); in ff_dh_write_public_key()
[all …]
Drtmpdh.h53 FFBigNum pub_key; member
90 int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len);
103 int ff_dh_compute_shared_secret_key(FF_DH *dh, const uint8_t *pub_key,
/third_party/openssl/apps/
Dtestdsa.h217 BIGNUM *priv_key, *pub_key, *p, *q, *g; in get_dsa() local
237 pub_key = BN_bin2bn(dsa_t.pub, dsa_t.pub_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()
255 BN_free(pub_key); in get_dsa()
/third_party/openssl/include/openssl/
Ddh.h150 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key);
153 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes);
155 int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
156 int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);
187 const BIGNUM **pub_key, const BIGNUM **priv_key);
188 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
213 (unsigned char *key, const BIGNUM *pub_key, DH *dh);
215 int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh));
/third_party/openssl/crypto/pem/
Dpvkfmt.c253 BIGNUM *pub_key = NULL; in b2i_dss() local
271 if (!read_lebn(&p, nbyte, &pub_key)) in b2i_dss()
281 pub_key = BN_new(); in b2i_dss()
282 if (pub_key == NULL) 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()
312 BN_free(pub_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()
[all …]
/third_party/openssl/doc/man3/
DDH_generate_key.pod14 int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
16 int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);
28 corresponding public value B<dh-E<gt>pub_key>, which can then be
32 in B<dh> and the other party's public value in B<pub_key> and stores
DDH_get0_pqg.pod19 const BIGNUM **pub_key, const BIGNUM **priv_key);
20 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
36 parameter is optional. It also contains a public key (B<pub_key>) and
54 pointer to the public key will be stored in B<*pub_key>, and a pointer to the
59 Any of the out parameters B<pub_key> and B<priv_key> can be NULL, in which case
68 Any of the values B<p>, B<q>, B<g>, B<priv_key>, and B<pub_key> can also be
DDSA_get0_pqg.pod20 const BIGNUM **pub_key, const BIGNUM **priv_key);
21 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
35 public key (B<pub_key>) and (optionally) a private key (B<priv_key>).
50 pointer to the public key will be stored in B<*pub_key>, and a pointer to the
64 Any of the values B<p>, B<q>, B<g>, B<priv_key>, and B<pub_key> can also be
/third_party/openssl/test/
Ddhtest.c534 BIGNUM *bady = NULL, *priv_key = NULL, *pub_key = NULL; in rfc5114_test() local
545 || !TEST_ptr(pub_key = BN_bin2bn(td->yA, td->yA_len, NULL)) in rfc5114_test()
546 || !TEST_true(DH_set0_key(dhA, pub_key, priv_key))) in rfc5114_test()
550 || !TEST_ptr(pub_key = BN_bin2bn(td->yB, td->yB_len, NULL)) in rfc5114_test()
551 || !TEST_true( DH_set0_key(dhB, pub_key, priv_key))) in rfc5114_test()
553 priv_key = pub_key = NULL; in rfc5114_test()
620 BN_free(pub_key); in rfc5114_test()
/third_party/libcoap/src/
Dcoap_tinydtls.c35 coap_binary_t *pub_key; member
353 ecdsa_key.pub_key_x = t_context->pub_key->s; in get_ecdsa_key()
354 ecdsa_key.pub_key_y = &t_context->pub_key->s[DTLS_EC_KEY_SIZE]; in get_ecdsa_key()
465 if (t_context->pub_key) { in coap_dtls_free_context()
466 coap_delete_binary(t_context->pub_key); in coap_dtls_free_context()
467 t_context->pub_key = NULL; in coap_dtls_free_context()
911 t_context->pub_key = get_asn1_tag(COAP_ASN1_BITSTRING, pub_data, pub_len, in asn1_derive_keys()
913 if (!t_context->pub_key) { in asn1_derive_keys()
920 t_context->pub_key->s += 2; in asn1_derive_keys()
921 t_context->pub_key->length -= 2; in asn1_derive_keys()
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/crypto/
Dcrypto_openssl.c779 publen = BN_num_bytes(dh->pub_key); in dh5_init()
788 BN_bn2bin(dh->pub_key, wpabuf_put(pubkey, publen)); in dh5_init()
805 const BIGNUM *priv_key = NULL, *pub_key = NULL; in dh5_init()
828 DH_get0_key(dh, &pub_key, &priv_key); in dh5_init()
829 publen = BN_num_bytes(pub_key); in dh5_init()
838 BN_bn2bin(pub_key, wpabuf_put(pubkey, publen)); in dh5_init()
880 dh->pub_key = BN_bin2bn(wpabuf_head(publ), wpabuf_len(publ), NULL); in dh5_init_fixed()
881 if (dh->pub_key == NULL) in dh5_init_fixed()
894 BIGNUM *p = NULL, *g, *priv_key = NULL, *pub_key = NULL; in dh5_init_fixed()
909 pub_key = BN_bin2bn(wpabuf_head(publ), wpabuf_len(publ), NULL); in dh5_init_fixed()
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/crypto/
Dcrypto_openssl.c852 publen = BN_num_bytes(dh->pub_key); in dh5_init()
861 BN_bn2bin(dh->pub_key, wpabuf_put(pubkey, publen)); in dh5_init()
878 const BIGNUM *priv_key = NULL, *pub_key = NULL; in dh5_init()
901 DH_get0_key(dh, &pub_key, &priv_key); in dh5_init()
902 publen = BN_num_bytes(pub_key); in dh5_init()
911 BN_bn2bin(pub_key, wpabuf_put(pubkey, publen)); in dh5_init()
953 dh->pub_key = BN_bin2bn(wpabuf_head(publ), wpabuf_len(publ), NULL); in dh5_init_fixed()
954 if (dh->pub_key == NULL) in dh5_init_fixed()
967 BIGNUM *p = NULL, *g, *priv_key = NULL, *pub_key = NULL; in dh5_init_fixed()
982 pub_key = BN_bin2bn(wpabuf_head(publ), wpabuf_len(publ), NULL); in dh5_init_fixed()
[all …]

123