Home
last modified time | relevance | path

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

123

/freebsd-12-stable/crypto/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()
/freebsd-12-stable/crypto/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.c177 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key) in DH_check_pub_key_ex() argument
181 if (!DH_check_pub_key(dh, pub_key, &errflags)) in DH_check_pub_key_ex()
194 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret) in DH_check_pub_key() argument
208 if (BN_cmp(pub_key, tmp) <= 0) in DH_check_pub_key()
212 if (BN_cmp(pub_key, tmp) >= 0) in DH_check_pub_key()
217 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);
/freebsd-12-stable/crypto/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
/freebsd-12-stable/crypto/openssh/openbsd-compat/
Dlibressl-api-compat.c200 DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) in DSA_get0_key() argument
202 if (pub_key != NULL) in DSA_get0_key()
203 *pub_key = d->pub_key; in DSA_get0_key()
211 DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) in DSA_set0_key() argument
213 if (d->pub_key == NULL && pub_key == NULL) in DSA_set0_key()
216 if (pub_key != NULL) { in DSA_set0_key()
217 BN_free(d->pub_key); in DSA_set0_key()
218 d->pub_key = pub_key; in DSA_set0_key()
489 DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
491 if (pub_key != NULL) in DH_get0_key()
[all …]
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);
/freebsd-12-stable/crypto/openssh/
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()
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()
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()
/freebsd-12-stable/crypto/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()
/freebsd-12-stable/contrib/ntp/libntp/
Dlibssl_compat.c303 *ppub_key = pdsa->pub_key; in sslshim_DSA_get0_key()
311 BIGNUM * pub_key, in sslshim_DSA_set0_key() argument
316 if (!(pdsa->pub_key || pub_key)) in sslshim_DSA_set0_key()
319 replace_bn_nn(&pdsa->pub_key, pub_key); in sslshim_DSA_set0_key()
/freebsd-12-stable/crypto/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));
/freebsd-12-stable/crypto/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 …]
/freebsd-12-stable/contrib/ldns/
Dkeys.c226 EC_POINT* pub_key; in ldns_EC_KEY_calc_public() local
229 pub_key = EC_POINT_new(group); in ldns_EC_KEY_calc_public()
230 if(!pub_key) return 0; in ldns_EC_KEY_calc_public()
231 if(!EC_POINT_copy(pub_key, EC_GROUP_get0_generator(group))) { in ldns_EC_KEY_calc_public()
232 EC_POINT_free(pub_key); in ldns_EC_KEY_calc_public()
235 if(!EC_POINT_mul(group, pub_key, EC_KEY_get0_private_key(ec), in ldns_EC_KEY_calc_public()
237 EC_POINT_free(pub_key); in ldns_EC_KEY_calc_public()
240 if(EC_KEY_set_public_key(ec, pub_key) == 0) { in ldns_EC_KEY_calc_public()
241 EC_POINT_free(pub_key); in ldns_EC_KEY_calc_public()
244 EC_POINT_free(pub_key); in ldns_EC_KEY_calc_public()
[all …]
/freebsd-12-stable/crypto/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
/freebsd-12-stable/crypto/openssh/regress/unittests/sshkey/
Dcommon.c144 const BIGNUM *pub_key = NULL; in dsa_pub_key() local
148 DSA_get0_key(k->dsa, &pub_key, NULL); in dsa_pub_key()
149 return pub_key; in dsa_pub_key()
/freebsd-12-stable/contrib/wpa/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