Searched refs:pub_key (Results 1 - 25 of 40) sorted by relevance

12

/openbsd-current/lib/libcrypto/dsa/
H A Ddsa_key.c75 BIGNUM *pub_key = NULL, *priv_key = NULL; local
81 if ((pub_key = BN_new()) == NULL)
89 if (!BN_mod_exp_ct(pub_key, dsa->g, priv_key, dsa->p, ctx))
96 BN_free(dsa->pub_key);
97 dsa->pub_key = pub_key;
98 pub_key = NULL;
103 BN_free(pub_key);
H A Ddsa_lib.c165 BN_free(dsa->pub_key);
234 * DSA has p, q, g, optional pub_key, optional priv_key.
235 * DH has p, optional length, g, optional pub_key, optional priv_key,
259 if (dsa->pub_key != NULL) {
260 if ((dh->pub_key = BN_dup(dsa->pub_key)) == NULL)
314 DSA_get0_key(const DSA *dsa, const BIGNUM **pub_key, const BIGNUM **priv_key) argument
316 if (pub_key != NULL)
317 *pub_key = dsa->pub_key;
324 DSA_set0_key(DSA *dsa, BIGNUM *pub_key, BIGNUM *priv_key) argument
[all...]
H A Ddsa_ameth.c118 BN_free(dsa->pub_key);
119 if ((dsa->pub_key = ASN1_INTEGER_to_BN(aint, NULL)) == NULL) {
171 if ((aint = BN_to_ASN1_INTEGER(dsa->pub_key, NULL)) == NULL) {
252 BN_free(dsa->pub_key);
253 if ((dsa->pub_key = BN_new()) == NULL) {
265 if (!BN_mod_exp_ct(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) {
401 if (BN_cmp(b->pkey.dsa->pub_key, a->pkey.dsa->pub_key) != 0)
417 const BIGNUM *priv_key, *pub_key; local
426 pub_key
[all...]
H A Ddsa_local.h86 BIGNUM *pub_key; /* y public key */ member in struct:dsa_st
/openbsd-current/lib/libcrypto/dh/
H A Ddh_key.c75 BIGNUM *pub_key = NULL, *priv_key = NULL; local
91 if ((pub_key = dh->pub_key) == NULL) {
92 if ((pub_key = BN_new()) == NULL)
115 if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, priv_key, dh->p, ctx,
119 dh->pub_key = pub_key;
126 if (dh->pub_key == NULL)
127 BN_free(pub_key);
136 compute_key(unsigned char *key, const BIGNUM *pub_key, D argument
220 DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) argument
[all...]
H A Ddh_local.h68 int (*compute_key)(unsigned char *key,const BIGNUM *pub_key,DH *dh);
88 BIGNUM *pub_key; /* g^x */ member in struct:dh_st
112 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key);
H A Ddh_lib.c162 BN_free(dh->pub_key);
270 DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) argument
272 if (pub_key != NULL)
273 *pub_key = dh->pub_key;
280 DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) argument
282 if (pub_key != NULL) {
283 BN_free(dh->pub_key);
284 dh->pub_key = pub_key;
[all...]
H A Ddh_ameth.c114 BN_free(dh->pub_key);
115 if ((dh->pub_key = ASN1_INTEGER_to_BN(aint, NULL)) == NULL) {
158 if ((aint = BN_to_ASN1_INTEGER(dh->pub_key, NULL)) == NULL)
335 BIGNUM *priv_key, *pub_key; local
343 pub_key = x->pub_key;
345 pub_key = NULL;
367 if (!bn_printf(bp, pub_key, indent, "public-key:"))
449 if (BN_cmp(b->pkey.dh->pub_key, a->pkey.dh->pub_key) !
[all...]
H A Ddh.h150 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key);
151 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
174 int DH_check_pub_key(const DH *dh,const BIGNUM *pub_key, int *codes);
176 int DH_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh);
H A Ddh_check.c233 DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key) argument
237 if (!DH_check_pub_key(dh, pub_key, &flags))
251 DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *flags) argument
266 * Check that 1 < pub_key < dh->p - 1
269 if (BN_cmp(pub_key, BN_value_one()) <= 0)
276 if (BN_cmp(pub_key, max_pub_key) >= 0)
280 * If dh->q is set, check that pub_key^q == 1 mod p
289 if (!BN_mod_exp_ct(residue, pub_key, dh->q, dh->p, ctx))
/openbsd-current/lib/libcrypto/ec/
H A Dec_key.c118 EC_POINT_free(r->pub_key);
148 if (src->pub_key && src->group) {
149 EC_POINT_free(dest->pub_key);
150 dest->pub_key = EC_POINT_new(src->group);
151 if (dest->pub_key == NULL)
153 if (!EC_POINT_copy(dest->pub_key, src->pub_key))
239 EC_POINT *pub_key = NULL; local
250 if ((pub_key = EC_POINT_new(eckey->group)) == NULL)
257 if (!EC_POINT_mul(eckey->group, pub_key, priv_ke
456 EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub_key) argument
[all...]
H A Decx_methods.c85 freezero(ecx_key->pub_key, ecx_key->pub_key_len);
86 ecx_key->pub_key = NULL;
104 uint8_t *pub_key = NULL, *priv_key = NULL; local
109 if ((pub_key = calloc(1, ecx_key->key_len)) == NULL)
116 ED25519_keypair(pub_key, priv_key);
119 X25519_keypair(pub_key, priv_key);
129 ecx_key->pub_key = pub_key;
131 pub_key = NULL;
136 freezero(pub_key, ecx_ke
146 uint8_t *pub_key = NULL; local
183 ecx_key_set_pub(struct ecx_key_st *ecx_key, const uint8_t *pub_key, size_t pub_key_len) argument
247 uint8_t *pub_key = NULL; local
[all...]
H A Dec_kmeth.c146 ret->pub_key = NULL;
196 int (*set_public)(EC_KEY *key, const EC_POINT *pub_key))
216 int (*ckey)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key,
260 int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key))
288 int (**pck)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key,
190 EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth, int (*init)(EC_KEY *key), void (*finish)(EC_KEY *key), int (*copy)(EC_KEY *dest, const EC_KEY *src), int (*set_group)(EC_KEY *key, const EC_GROUP *grp), int (*set_private)(EC_KEY *key, const BIGNUM *priv_key), int (*set_public)(EC_KEY *key, const EC_POINT *pub_key)) argument
215 EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth, int (*ckey)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key, const EC_KEY *ecdh)) argument
254 EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth, int (**pinit)(EC_KEY *key), void (**pfinish)(EC_KEY *key), int (**pcopy)(EC_KEY *dest, const EC_KEY *src), int (**pset_group)(EC_KEY *key, const EC_GROUP *grp), int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key), int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)) argument
287 EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, int (**pck)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key, const EC_KEY *ecdh)) argument
H A Dec_asn1.c1098 if (ret->pub_key)
1099 EC_POINT_free(ret->pub_key);
1100 ret->pub_key = EC_POINT_new(ret->group);
1101 if (ret->pub_key == NULL) {
1119 if (!EC_POINT_oct2point(ret->group, ret->pub_key,
1125 if (!EC_POINT_mul(ret->group, ret->pub_key, ret->priv_key,
1158 (!(a->enc_flag & EC_PKEY_NO_PUBKEY) && a->pub_key == NULL)) {
1189 if (!(a->enc_flag & EC_PKEY_NO_PUBKEY) && a->pub_key != NULL) {
1195 tmp_len = EC_POINT_point2oct(a->group, a->pub_key,
1207 if (!EC_POINT_point2oct(a->group, a->pub_key,
[all...]
H A Dec_ameth.c312 EC_POINT *pub_key = NULL; local
319 if ((pub_key = EC_POINT_new(group)) == NULL)
321 if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, NULL))
323 if (!EC_KEY_set_public_key(eckey, pub_key))
325 pub_key = NULL;
330 EC_POINT_free(pub_key);
495 BIGNUM *pub_key = NULL; local
513 if ((pub_key = EC_POINT_point2bn(group, public_key,
540 if (!bn_printf(bp, pub_key, off, "pub: "))
550 BN_free(pub_key);
[all...]
/openbsd-current/usr.bin/ssh/
H A Dkexdh.c110 const BIGNUM *pub_key; local
116 DH_get0_key(kex->dh, &pub_key, NULL);
119 if ((r = sshbuf_put_bignum2(buf, pub_key)) != 0 ||
125 BN_print_fp(stderr, pub_key);
139 const BIGNUM *pub_key; local
148 DH_get0_key(kex->dh, &pub_key, NULL);
153 if ((r = sshbuf_put_bignum2(server_blob, pub_key)) != 0 ||
H A Dkexgexc.c92 const BIGNUM *pub_key; local
116 DH_get0_key(kex->dh, &pub_key, NULL);
118 (r = sshpkt_put_bignum2(ssh, pub_key)) != 0 ||
125 BN_print_fp(stderr, pub_key);
142 const BIGNUM *pub_key, *dh_p, *dh_g; local
180 DH_get0_key(kex->dh, &pub_key, NULL);
192 pub_key,
H A Dkexecdh.c92 const EC_POINT *pub_key; local
114 pub_key = EC_KEY_get0_public_key(server_key);
119 if ((r = sshbuf_put_ec(server_blob, pub_key, group)) != 0 ||
H A Dkexgexs.c124 const BIGNUM *pub_key, *dh_p, *dh_g; local
158 DH_get0_key(kex->dh, &pub_key, NULL);
171 pub_key,
184 (r = sshpkt_put_bignum2(ssh, pub_key)) != 0 || /* f */
H A Ddh.c280 const BIGNUM *dh_p, *pub_key; local
299 DH_get0_key(dh, &pub_key, NULL);
300 if (!dh_pub_is_valid(dh, pub_key))
/openbsd-current/lib/libcrypto/ecdh/
H A Decdh.c146 ecdh_compute_key(unsigned char **out, size_t *out_len, const EC_POINT *pub_key, argument
172 if (EC_POINT_is_on_curve(group, pub_key, ctx) <= 0)
185 if (!EC_POINT_mul(group, point, NULL, pub_key, priv_key, ctx)) {
225 ECDH_compute_key(void *out, size_t out_len, const EC_POINT *pub_key, argument
243 if (!eckey->meth->compute_key(&secret, &secret_len, pub_key, eckey))
/openbsd-current/regress/sbin/isakmpd/x509/
H A Dx509test.c164 RSA *pub_key, *priv_key; local
228 pub_key = pkey_pub->pkey.rsa;
229 if (pub_key == NULL)
243 err = RSA_public_decrypt (len, enc, dec, pub_key, RSA_PKCS1_PADDING);
/openbsd-current/regress/lib/libcrypto/evp/
H A Devp_ecx_test.c180 uint8_t *pub_key = NULL; local
233 if ((pub_key = malloc(pub_key_len)) == NULL)
235 if (!EVP_PKEY_get_raw_public_key(pkey, pub_key, &pub_key_len)) {
239 if (memcmp(pub_key, ed25519_raw_pub_key_1, pub_key_len) != 0) {
242 hexdump(pub_key, pub_key_len);
258 freezero(pub_key, pub_key_len);
259 pub_key = NULL;
299 if ((pub_key = malloc(pub_key_len)) == NULL)
301 if (!EVP_PKEY_get_raw_public_key(pkey, pub_key, &pub_key_len)) {
305 if (memcmp(pub_key, ed25519_raw_pub_key_
612 uint8_t *pub_key = NULL; local
[all...]
/openbsd-current/regress/usr.bin/ssh/unittests/sshkey/
H A Dcommon.c133 const BIGNUM *pub_key = NULL; local
137 DSA_get0_key(k->dsa, &pub_key, NULL);
138 return pub_key;
/openbsd-current/lib/libssl/
H A Dssl_kex.c205 BIGNUM *pub_key = NULL; local
218 if ((pub_key = BN_bin2bn(CBS_data(&dh_y), CBS_len(&dh_y),
222 if (!DH_set0_key(dh, pub_key, NULL))
224 pub_key = NULL;
234 BN_free(pub_key);

Completed in 245 milliseconds

12