Home
last modified time | relevance | path

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

12

/dragonfly/crypto/libressl/crypto/ec/
H A Dec_key.c122 EC_POINT_free(r->pub_key); in EC_KEY_free()
163 if (dest->pub_key == NULL) in EC_KEY_copy()
165 if (!EC_POINT_copy(dest->pub_key, src->pub_key)) in EC_KEY_copy()
265 EC_POINT *pub_key = NULL; in ossl_ec_key_gen() local
288 if ((pub_key = eckey->pub_key) == NULL) { in ossl_ec_key_gen()
297 eckey->pub_key = pub_key; in ossl_ec_key_gen()
303 if (eckey->pub_key == NULL) in ossl_ec_key_gen()
304 EC_POINT_free(pub_key); in ossl_ec_key_gen()
468 return key->pub_key; in EC_KEY_get0_public_key()
477 EC_POINT_free(key->pub_key); in EC_KEY_set_public_key()
[all …]
H A Dec_ameth.c268 EC_POINT *pub_key; in eckey_priv_decode() local
274 pub_key = EC_POINT_new(group); in eckey_priv_decode()
275 if (pub_key == NULL) { in eckey_priv_decode()
280 EC_POINT_free(pub_key); in eckey_priv_decode()
286 EC_POINT_free(pub_key); in eckey_priv_decode()
291 EC_POINT_free(pub_key); in eckey_priv_decode()
295 EC_POINT_free(pub_key); in eckey_priv_decode()
445 BIGNUM *pub_key = NULL, *order = NULL; in do_EC_KEY_print() local
468 if (pub_key) in do_EC_KEY_print()
506 if ((pub_key != NULL) && !ASN1_bn_print(bp, "pub: ", pub_key, in do_EC_KEY_print()
[all …]
H A Dec_kmeth.c166 ret->pub_key = NULL; in EC_KEY_new_method()
214 int (*set_public)(EC_KEY *key, const EC_POINT *pub_key)) in EC_KEY_METHOD_set_init() argument
232 int (*ckey)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, in EC_KEY_METHOD_set_compute_key() argument
273 int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)) in EC_KEY_METHOD_get_init() argument
299 int (**pck)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, in EC_KEY_METHOD_get_compute_key() argument
H A Dec_asn1.c1373 if (ret->pub_key) in d2i_ECPrivateKey()
1374 EC_POINT_clear_free(ret->pub_key); in d2i_ECPrivateKey()
1375 ret->pub_key = EC_POINT_new(ret->group); in d2i_ECPrivateKey()
1376 if (ret->pub_key == NULL) { in d2i_ECPrivateKey()
1394 if (!EC_POINT_oct2point(ret->group, ret->pub_key, in d2i_ECPrivateKey()
1400 if (!EC_POINT_mul(ret->group, ret->pub_key, ret->priv_key, in d2i_ECPrivateKey()
1469 tmp_len = EC_POINT_point2oct(a->group, a->pub_key, in i2d_ECPrivateKey()
1481 if (!EC_POINT_point2oct(a->group, a->pub_key, in i2d_ECPrivateKey()
1557 if (ret->pub_key == NULL && in o2i_ECPublicKey()
1558 (ret->pub_key = EC_POINT_new(ret->group)) == NULL) { in o2i_ECPublicKey()
[all …]
/dragonfly/crypto/libressl/crypto/dh/
H A Ddh_key.c82 DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) in DH_compute_key() argument
84 return dh->meth->compute_key(key, pub_key, dh); in DH_compute_key()
109 BIGNUM *pub_key = NULL, *priv_key = NULL, *two = NULL; in generate_key() local
125 if ((pub_key = dh->pub_key) == NULL) { in generate_key()
126 if ((pub_key = BN_new()) == NULL) in generate_key()
153 if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, priv_key, dh->p, ctx, in generate_key()
157 dh->pub_key = pub_key; in generate_key()
164 if (dh->pub_key == NULL) in generate_key()
165 BN_free(pub_key); in generate_key()
174 compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) in compute_key() argument
[all …]
H A Ddh_ameth.c137 ASN1_INTEGER *pub_key = NULL; in dh_pub_encode() local
154 pub_key = BN_to_ASN1_INTEGER(dh->pub_key, NULL); in dh_pub_encode()
155 if (!pub_key) in dh_pub_encode()
158 penclen = i2d_ASN1_INTEGER(pub_key, &penc); in dh_pub_encode()
160 ASN1_INTEGER_free(pub_key); in dh_pub_encode()
320 BIGNUM *priv_key, *pub_key; in do_dh_print() local
328 pub_key = x->pub_key; in do_dh_print()
330 pub_key = NULL; in do_dh_print()
340 update_buflen(pub_key, &buf_len); in do_dh_print()
447 if (BN_cmp(b->pkey.dh->pub_key, a->pkey.dh->pub_key) != 0) in dh_pub_cmp()
[all …]
H A Ddh_lib.c156 ret->pub_key = NULL; in DH_new_method()
203 BN_clear_free(r->pub_key); in DH_free()
302 DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
304 if (pub_key != NULL) in DH_get0_key()
305 *pub_key = dh->pub_key; in DH_get0_key()
311 DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
313 if (pub_key != NULL) { in DH_set0_key()
314 BN_free(dh->pub_key); in DH_set0_key()
315 dh->pub_key = pub_key; in DH_set0_key()
352 return dh->pub_key; in DH_get0_pub_key()
H A Ddh_check.c232 DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key) in DH_check_pub_key_ex() argument
236 if (!DH_check_pub_key(dh, pub_key, &flags)) in DH_check_pub_key_ex()
250 DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *flags) in DH_check_pub_key() argument
268 if (BN_cmp(pub_key, BN_value_one()) <= 0) in DH_check_pub_key()
275 if (BN_cmp(pub_key, max_pub_key) >= 0) in DH_check_pub_key()
288 if (!BN_mod_exp_ct(residue, pub_key, dh->q, dh->p, ctx)) in DH_check_pub_key()
H A Ddh_local.h68 int (*compute_key)(unsigned char *key,const BIGNUM *pub_key,DH *dh);
88 BIGNUM *pub_key; /* g^x */ member
113 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key);
/dragonfly/crypto/libressl/crypto/dsa/
H A Ddsa_key.c87 BIGNUM *pub_key = NULL, *priv_key = NULL; in dsa_builtin_keygen() local
100 if ((pub_key = dsa->pub_key) == NULL) { in dsa_builtin_keygen()
101 if ((pub_key = BN_new()) == NULL) in dsa_builtin_keygen()
105 if (!BN_mod_exp_ct(pub_key, dsa->g, priv_key, dsa->p, ctx)) in dsa_builtin_keygen()
109 dsa->pub_key = pub_key; in dsa_builtin_keygen()
113 if (dsa->pub_key == NULL) in dsa_builtin_keygen()
114 BN_free(pub_key); in dsa_builtin_keygen()
H A Ddsa_lib.c161 ret->pub_key = NULL; in DSA_new_method()
206 BN_clear_free(r->pub_key); in DSA_free()
291 if (r->pub_key != NULL) in DSA_dup_DH()
292 if ((ret->pub_key = BN_dup(r->pub_key)) == NULL) in DSA_dup_DH()
343 if (pub_key != NULL) in DSA_get0_key()
344 *pub_key = d->pub_key; in DSA_get0_key()
352 if (d->pub_key == NULL && pub_key == NULL) in DSA_set0_key()
355 if (pub_key != NULL) { in DSA_set0_key()
356 BN_free(d->pub_key); in DSA_set0_key()
357 d->pub_key = pub_key; in DSA_set0_key()
[all …]
H A Ddsa_ameth.c116 if (!(dsa->pub_key = ASN1_INTEGER_to_BN(public_key, NULL))) { in dsa_pub_decode()
156 if ((pubint = BN_to_ASN1_INTEGER(dsa->pub_key, NULL)) == NULL) { in dsa_pub_encode()
220 if (!(dsa->pub_key = BN_new())) { in dsa_priv_decode()
229 if (!BN_mod_exp_ct(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) { in dsa_priv_decode()
361 if (BN_cmp(b->pkey.dsa->pub_key, a->pkey.dsa->pub_key) != 0) in dsa_pub_cmp()
391 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local
399 pub_key = x->pub_key; in do_dsa_print()
401 pub_key = NULL; in do_dsa_print()
414 update_buflen(pub_key, &buf_len); in do_dsa_print()
432 if (!ASN1_bn_print(bp, "pub: ", pub_key, m, off)) in do_dsa_print()
/dragonfly/crypto/libressl/crypto/gost/
H A Dgostr341001_key.c66 EC_POINT *pub_key; member
85 ret->pub_key = NULL; in GOST_KEY_new()
105 EC_POINT_free(r->pub_key); in GOST_KEY_free()
123 if (EC_POINT_is_at_infinity(key->group, key->pub_key) != 0) { in GOST_KEY_check_key()
133 if (EC_POINT_is_on_curve(key->group, key->pub_key, ctx) == 0) { in GOST_KEY_check_key()
144 if (EC_POINT_mul(key->group, point, NULL, key->pub_key, order, in GOST_KEY_check_key()
264 return key->pub_key; in GOST_KEY_get0_public_key()
268 GOST_KEY_set_public_key(GOST_KEY *key, const EC_POINT *pub_key) in GOST_KEY_set_public_key() argument
270 EC_POINT_free(key->pub_key); in GOST_KEY_set_public_key()
271 key->pub_key = EC_POINT_dup(pub_key, key->group); in GOST_KEY_set_public_key()
[all …]
H A Dgostr341001.c107 EC_POINT *pub_key = NULL; in gost2001_compute_public() local
125 pub_key = EC_POINT_new(group); in gost2001_compute_public()
126 if (pub_key == NULL) in gost2001_compute_public()
128 if (EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx) == 0) in gost2001_compute_public()
130 if (GOST_KEY_set_public_key(ec, pub_key) == 0) in gost2001_compute_public()
138 EC_POINT_free(pub_key); in gost2001_compute_public()
258 const EC_POINT *pub_key = NULL; in gost2001_do_verify() local
283 pub_key = GOST_KEY_get0_public_key(ec); in gost2001_do_verify()
304 if (EC_POINT_mul(group, C, z1, pub_key, z2, ctx) == 0) { in gost2001_do_verify()
336 const EC_POINT *pub_key = GOST_KEY_get0_public_key(pkey); in VKO_compute_key() local
[all …]
/dragonfly/crypto/libressl/crypto/ecdh/
H A Dech_key.c84 static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key,
96 ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, in ecdh_compute_key() argument
131 if (!EC_POINT_is_on_curve(group, pub_key, ctx)) in ecdh_compute_key()
139 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { in ecdh_compute_key()
209 ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, in ossl_ecdh_compute_key() argument
217 return ecdh->meth->compute_key(out, outlen, pub_key, eckey, KDF); in ossl_ecdh_compute_key()
221 ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, in ECDH_compute_key() argument
226 return eckey->meth->compute_key(out, outlen, pub_key, eckey, KDF); in ECDH_compute_key()
/dragonfly/crypto/libressl/apps/openssl/
H A Dtestdsa.h219 BIGNUM *priv_key = NULL, *pub_key = NULL; in get_dsa() local
226 pub_key = BN_bin2bn(pub, pub_size, NULL); in get_dsa()
227 if (priv_key == NULL || pub_key == NULL) in get_dsa()
230 if (!DSA_set0_key(dsa, pub_key, priv_key)) in get_dsa()
232 pub_key = NULL; in get_dsa()
252 BN_free(pub_key); in get_dsa()
/dragonfly/crypto/openssh/
H A Dkexdh.c117 const BIGNUM *pub_key; in kex_dh_keypair() local
123 DH_get0_key(kex->dh, &pub_key, NULL); in kex_dh_keypair()
126 if ((r = sshbuf_put_bignum2(buf, pub_key)) != 0 || in kex_dh_keypair()
132 BN_print_fp(stderr, pub_key); in kex_dh_keypair()
146 const BIGNUM *pub_key; in kex_dh_enc() local
155 DH_get0_key(kex->dh, &pub_key, NULL); in kex_dh_enc()
160 if ((r = sshbuf_put_bignum2(server_blob, pub_key)) != 0 || in kex_dh_enc()
H A Dkexgexc.c99 const BIGNUM *pub_key; in input_kex_dh_gex_group() local
123 DH_get0_key(kex->dh, &pub_key, NULL); in input_kex_dh_gex_group()
125 (r = sshpkt_put_bignum2(ssh, pub_key)) != 0 || in input_kex_dh_gex_group()
132 BN_print_fp(stderr, pub_key); in input_kex_dh_gex_group()
149 const BIGNUM *pub_key, *dh_p, *dh_g; in input_kex_dh_gex_reply() local
187 DH_get0_key(kex->dh, &pub_key, NULL); in input_kex_dh_gex_reply()
199 pub_key, in input_kex_dh_gex_reply()
H A Dkexgexs.c132 const BIGNUM *pub_key, *dh_p, *dh_g; in input_kex_dh_gex_init() local
166 DH_get0_key(kex->dh, &pub_key, NULL); in input_kex_dh_gex_init()
179 pub_key, in input_kex_dh_gex_init()
192 (r = sshpkt_put_bignum2(ssh, pub_key)) != 0 || /* f */ in input_kex_dh_gex_init()
H A Dkexecdh.c96 const EC_POINT *pub_key; in kex_ecdh_enc() local
118 pub_key = EC_KEY_get0_public_key(server_key); in kex_ecdh_enc()
123 if ((r = sshbuf_put_ec(server_blob, pub_key, group)) != 0 || in kex_ecdh_enc()
/dragonfly/contrib/ldns/
H A Dkeys.c234 EC_POINT* pub_key; in ldns_EC_KEY_calc_public() local
237 pub_key = EC_POINT_new(group); in ldns_EC_KEY_calc_public()
238 if(!pub_key) return 0; in ldns_EC_KEY_calc_public()
240 EC_POINT_free(pub_key); in ldns_EC_KEY_calc_public()
252 EC_POINT_free(pub_key); in ldns_EC_KEY_calc_public()
980 if (!pub_key) { in ldns_key_new_frm_fp_dsa_l()
991 dsa->pub_key = pub_key; in ldns_key_new_frm_fp_dsa_l()
1016 BN_free(pub_key); in ldns_key_new_frm_fp_dsa_l()
1699 const BIGNUM *pub_key, *priv_key; in ldns_key_dsa2bin() local
1714 pub_key = k->pub_key; priv_key = k->priv_key; in ldns_key_dsa2bin()
[all …]
/dragonfly/lib/libssh/openbsd-compat/
H A Dopenssl-compat.h82 void DSA_get0_key(const DSA *d, const BIGNUM **pub_key,
87 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
158 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key);
162 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
/dragonfly/crypto/libressl/include/openssl/
H A Ddh.h152 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key);
153 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
175 int DH_check_pub_key(const DH *dh,const BIGNUM *pub_key, int *codes);
177 int DH_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh);
/dragonfly/crypto/libressl/ssl/
H A Dssl_kex.c206 BIGNUM *pub_key = NULL; in ssl_kex_peer_public_dhe() local
219 if ((pub_key = BN_bin2bn(CBS_data(&dh_y), CBS_len(&dh_y), in ssl_kex_peer_public_dhe()
223 if (!DH_set0_key(dh, pub_key, NULL)) in ssl_kex_peer_public_dhe()
225 pub_key = NULL; in ssl_kex_peer_public_dhe()
235 BN_free(pub_key); in ssl_kex_peer_public_dhe()
/dragonfly/contrib/wpa_supplicant/src/crypto/
H A Dcrypto_openssl.c779 publen = BN_num_bytes(dh->pub_key); 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()
881 if (dh->pub_key == NULL) in dh5_init_fixed()
910 if (!priv_key || !pub_key || DH_set0_key(dh, pub_key, priv_key) != 1) in dh5_init_fixed()
912 pub_key = NULL; in dh5_init_fixed()
923 BN_free(pub_key); in dh5_init_fixed()
934 BIGNUM *pub_key; in dh5_derive_shared() local
945 if (pub_key == NULL) in dh5_derive_shared()
957 BN_clear_free(pub_key); in dh5_derive_shared()
[all …]

12