Home
last modified time | relevance | path

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

1234

/freebsd/crypto/openssl/crypto/dsa/
H A Ddsa_key.c43 const BIGNUM *priv_key, BIGNUM *pub_key) in ossl_dsa_generate_public_key() argument
53 if (!BN_mod_exp(pub_key, dsa->params.g, prk, dsa->params.p, ctx)) in ossl_dsa_generate_public_key()
101 ret = !BN_cmp(dsa->pub_key, pub_key2); in dsa_keygen_knownanswer_test()
151 BIGNUM *pub_key = NULL, *priv_key = NULL; in dsa_keygen() local
178 if (dsa->pub_key == NULL) { in dsa_keygen()
179 if ((pub_key = BN_new()) == NULL) in dsa_keygen()
182 pub_key = dsa->pub_key; in dsa_keygen()
185 if (!ossl_dsa_generate_public_key(ctx, dsa, priv_key, pub_key)) in dsa_keygen()
189 dsa->pub_key = pub_key; in dsa_keygen()
202 BN_free(dsa->pub_key); in dsa_keygen()
[all …]
H A Ddsa_check.c66 int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret) in ossl_dsa_check_pub_key() argument
71 return ossl_ffc_validate_public_key(&dsa->params, pub_key, ret) in ossl_dsa_check_pub_key()
80 int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key, int *ret) in ossl_dsa_check_pub_key_partial() argument
85 return ossl_ffc_validate_public_key_partial(&dsa->params, pub_key, ret) in ossl_dsa_check_pub_key_partial()
107 BIGNUM *pub_key = NULL; in ossl_dsa_check_pairwise() local
114 || dsa->pub_key == NULL) in ossl_dsa_check_pairwise()
120 pub_key = BN_new(); in ossl_dsa_check_pairwise()
121 if (pub_key == NULL) in ossl_dsa_check_pairwise()
125 if (!ossl_dsa_generate_public_key(ctx, dsa, dsa->priv_key, pub_key)) in ossl_dsa_check_pairwise()
128 ret = BN_cmp(pub_key, dsa->pub_key) == 0; in ossl_dsa_check_pairwise()
[all …]
H A Ddsa_lib.c49 BIGNUM *pub_key = NULL, *priv_key = NULL; in DSA_dup_DH() local
60 if (r->pub_key != NULL) { in DSA_dup_DH()
61 pub_key = BN_dup(r->pub_key); in DSA_dup_DH()
62 if (pub_key == NULL) in DSA_dup_DH()
69 if (!DH_set0_key(ret, pub_key, priv_key)) in DSA_dup_DH()
79 BN_free(pub_key); in DSA_dup_DH()
239 BN_clear_free(r->pub_key); in DSA_free()
300 return d->pub_key; in DSA_get0_pub_key()
309 const BIGNUM **pub_key, const BIGNUM **priv_key) in DSA_get0_key() argument
311 if (pub_key != NULL) in DSA_get0_key()
[all …]
H A Ddsa_backend.c34 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dsa_key_fromdata() local
48 if (param_pub_key != NULL && !OSSL_PARAM_get_BN(param_pub_key, &pub_key)) in ossl_dsa_key_fromdata()
53 if (!DSA_set0_key(dsa, pub_key, priv_key)) in ossl_dsa_key_fromdata()
60 BN_free(pub_key); in ossl_dsa_key_fromdata()
99 || !dsa_bn_dup_check(&dupkey->pub_key, dsa->pub_key))) in ossl_dsa_dup()
H A Ddsa_ameth.c70 if ((dsa->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) { in dsa_pub_decode()
115 pubint = BN_to_ASN1_INTEGER(dsa->pub_key, NULL); in dsa_pub_encode()
263 return BN_cmp(b->pkey.dsa->pub_key, a->pkey.dsa->pub_key) == 0; in dsa_pub_cmp()
275 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local
287 pub_key = x->pub_key; in do_dsa_print()
289 pub_key = NULL; in do_dsa_print()
310 if (!ASN1_bn_print(bp, "pub: ", pub_key, NULL, off)) in do_dsa_print()
435 const BIGNUM *q = DSA_get0_q(dsa), *pub_key = DSA_get0_pub_key(dsa); in dsa_pkey_export_to() local
453 if (pub_key != NULL) { in dsa_pkey_export_to()
455 pub_key)) in dsa_pkey_export_to()
/freebsd/crypto/libecc/src/sig/
H A Dec_key.c139 int ec_pub_key_import_from_buf(ec_pub_key *pub_key, const ec_params *params, in ec_pub_key_import_from_buf() argument
145 MUST_HAVE(((pub_key != NULL) && (pub_key_buf != NULL) && (params != NULL)), ret, err); in ec_pub_key_import_from_buf()
148 ret = prj_pt_import_from_buf(&(pub_key->y), in ec_pub_key_import_from_buf()
161 ret = check_prj_pt_order(&(pub_key->y), &(params->ec_gen_order), PUBLIC_PT, &check); EG(ret, err); in ec_pub_key_import_from_buf()
166 pub_key->key_type = ec_key_alg; in ec_pub_key_import_from_buf()
167 pub_key->params = (const ec_params *)params; in ec_pub_key_import_from_buf()
168 pub_key->magic = PUB_KEY_MAGIC; in ec_pub_key_import_from_buf()
181 int ec_pub_key_import_from_aff_buf(ec_pub_key *pub_key, const ec_params *params, in ec_pub_key_import_from_aff_buf() argument
187 MUST_HAVE(((pub_key != NULL) && (pub_key_buf != NULL) && (params != NULL)), ret, err); in ec_pub_key_import_from_aff_buf()
190 ret = prj_pt_import_from_aff_buf(&(pub_key->y), in ec_pub_key_import_from_aff_buf()
[all …]
H A Deckcdsa.c205 const ec_pub_key *pub_key; in _eckcdsa_sign_init() local
221 pub_key = &(ctx->key_pair->pub_key); in _eckcdsa_sign_init()
222 p_len = (u8)BYTECEIL(pub_key->params->ec_fp.p_bitlen); in _eckcdsa_sign_init()
241 ret = prj_pt_to_aff(&y_aff, &(pub_key->y)); EG(ret, err); in _eckcdsa_sign_init()
246 dbg_pub_key_print("Y", pub_key); in _eckcdsa_sign_init()
262 PTR_NULLIFY(pub_key); in _eckcdsa_sign_init()
552 const ec_pub_key *pub_key; in _eckcdsa_verify_init() local
565 ret = pub_key_check_initialized_and_type(ctx->pub_key, ECKCDSA); EG(ret, err); in _eckcdsa_verify_init()
571 pub_key = ctx->pub_key; in _eckcdsa_verify_init()
572 p_len = (u8)BYTECEIL(pub_key->params->ec_fp.p_bitlen); in _eckcdsa_verify_init()
[all …]
H A Decfsdsa.c159 dbg_pub_key_print("Y", &(ctx->key_pair->pub_key)); in _ecfsdsa_sign_init()
433 ret = pub_key_check_initialized_and_type(ctx->pub_key, ECFSDSA); EG(ret, err); in _ecfsdsa_verify_init()
439 q = &(ctx->pub_key->params->ec_gen_order); in _ecfsdsa_verify_init()
440 p_bit_len = ctx->pub_key->params->ec_fp.p_bitlen; in _ecfsdsa_verify_init()
441 q_bit_len = ctx->pub_key->params->ec_gen_order_bitlen; in _ecfsdsa_verify_init()
453 ret = fp_init(&rx, ctx->pub_key->params->ec_curve.a.ctx); EG(ret, err); in _ecfsdsa_verify_init()
455 ret = fp_init(&ry, ctx->pub_key->params->ec_curve.a.ctx); EG(ret, err); in _ecfsdsa_verify_init()
459 ret = is_on_shortw_curve(&rx, &ry, &(ctx->pub_key->params->ec_curve), &on_curve); EG(ret, err); in _ecfsdsa_verify_init()
569 G = &(ctx->pub_key->params->ec_gen); in _ecfsdsa_verify_finalize()
570 Y = &(ctx->pub_key->y); in _ecfsdsa_verify_finalize()
[all …]
H A Dbip0340.c172 const ec_pub_key *pub_key; in _bip0340_sign() local
205 pub_key = &(key_pair->pub_key); in _bip0340_sign()
216 ret = prj_pt_copy(&Y, &(pub_key->y)); EG(ret, err); in _bip0340_sign()
362 PTR_NULLIFY(pub_key); in _bip0340_sign()
399 ret = pub_key_check_initialized_and_type(ctx->pub_key, BIP0340); EG(ret, err); in _bip0340_verify_init()
408 q = &(ctx->pub_key->params->ec_gen_order); in _bip0340_verify_init()
409 p_bit_len = ctx->pub_key->params->ec_fp.p_bitlen; in _bip0340_verify_init()
410 q_bit_len = ctx->pub_key->params->ec_gen_order_bitlen; in _bip0340_verify_init()
423 ret = prj_pt_copy(&Y, &(ctx->pub_key->y)); EG(ret, err); in _bip0340_verify_init()
427 ret = fp_init(rx, ctx->pub_key->params->ec_curve.a.ctx); EG(ret, err); in _bip0340_verify_init()
[all …]
H A Deddsa.c222 ret = eddsa_pub_key_sanity_check(&(key_pair->pub_key)); EG(ret, err); in eddsa_key_pair_sanity_check()
223 MUST_HAVE((key_pair->priv_key.key_type == key_pair->pub_key.key_type), ret, err); in eddsa_key_pair_sanity_check()
865 int eddsa_import_pub_key(ec_pub_key *pub_key, const u8 *buf, u16 buflen, argument
893 MUST_HAVE((pub_key != NULL) && (shortw_curve_params != NULL) && (buf != NULL), ret, err);
912 pub_key_y = &(pub_key->y);
939 ret = prj_pt_mul(&(pub_key->y), &tmp, pub_key_y); EG(ret, err1);
947 pub_key->key_type = sig_type;
948 pub_key->params = shortw_curve_params;
949 pub_key->magic = PUB_KEY_MAGIC;
952 ret = eddsa_pub_key_sanity_check(pub_key);
[all …]
/freebsd/crypto/openssl/crypto/ec/
H A Dec_key.c99 EC_POINT_free(r->pub_key); in EC_KEY_free()
136 if (src->pub_key != NULL) { in EC_KEY_copy()
137 EC_POINT_free(dest->pub_key); in EC_KEY_copy()
138 dest->pub_key = EC_POINT_new(src->group); in EC_KEY_copy()
139 if (dest->pub_key == NULL) in EC_KEY_copy()
141 if (!EC_POINT_copy(dest->pub_key, src->pub_key)) in EC_KEY_copy()
280 ret = !EC_POINT_cmp(eckey->group, eckey->pub_key, pub_key2, ctx); in ecdsa_keygen_knownanswer_test()
307 EC_POINT *pub_key = NULL; in ec_generate_key() local
357 if (eckey->pub_key == NULL) { in ec_generate_key()
358 pub_key = EC_POINT_new(group); in ec_generate_key()
[all …]
H A Decdh_ossl.c29 const EC_POINT *pub_key, const EC_KEY *ecdh) in ossl_ecdh_compute_key() argument
36 return ecdh->group->meth->ecdh_compute_key(psec, pseclen, pub_key, ecdh); in ossl_ecdh_compute_key()
50 const EC_POINT *pub_key, const EC_KEY *ecdh) in ossl_ecdh_simple_compute_key() argument
99 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { in ossl_ecdh_simple_compute_key()
/freebsd/crypto/openssl/crypto/dh/
H A Ddh_key.c40 int ossl_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) in ossl_dh_compute_key() argument
86 if (!dh->meth->bn_mod_exp(dh, z, pub_key, dh->priv_key, dh->params.p, ctx, in ossl_dh_compute_key()
114 int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) in DH_compute_key() argument
121 ret = ossl_dh_compute_key(key, pub_key, dh); in DH_compute_key()
123 ret = dh->meth->compute_key(key, pub_key, dh); in DH_compute_key()
144 int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh) in DH_compute_key_padded() argument
150 rv = ossl_dh_compute_key(key, pub_key, dh); in DH_compute_key_padded()
152 rv = dh->meth->compute_key(key, pub_key, dh); in DH_compute_key_padded()
230 const BIGNUM *priv_key, BIGNUM *pub_key) in ossl_dh_generate_public_key() argument
256 if (!dh->meth->bn_mod_exp(dh, pub_key, dh->params.g, prk, dh->params.p, in ossl_dh_generate_public_key()
[all …]
H A Ddh_check.c231 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key) in DH_check_pub_key_ex() argument
235 if (!DH_check_pub_key(dh, pub_key, &errflags)) in DH_check_pub_key_ex()
251 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret) in DH_check_pub_key() argument
265 return ossl_ffc_validate_public_key(&dh->params, pub_key, ret); in DH_check_pub_key()
273 int ossl_dh_check_pub_key_partial(const DH *dh, const BIGNUM *pub_key, int *ret) in ossl_dh_check_pub_key_partial() argument
275 return ossl_ffc_validate_public_key_partial(&dh->params, pub_key, ret) in ossl_dh_check_pub_key_partial()
337 BIGNUM *pub_key = NULL; in ossl_dh_check_pairwise() local
345 || dh->pub_key == NULL) in ossl_dh_check_pairwise()
358 pub_key = BN_new(); in ossl_dh_check_pairwise()
359 if (pub_key == NULL) in ossl_dh_check_pairwise()
[all …]
H A Ddh_ameth.c96 if ((dh->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) { in dh_pub_decode()
118 ASN1_INTEGER *pub_key = NULL; in dh_pub_encode() local
134 pub_key = BN_to_ASN1_INTEGER(dh->pub_key, NULL); in dh_pub_encode()
135 if (pub_key == NULL) in dh_pub_encode()
138 penclen = i2d_ASN1_INTEGER(pub_key, &penc); in dh_pub_encode()
140 ASN1_INTEGER_free(pub_key); in dh_pub_encode()
248 BIGNUM *priv_key, *pub_key; in do_dh_print() local
256 pub_key = x->pub_key; in do_dh_print()
258 pub_key = NULL; in do_dh_print()
261 || (ptype > 0 && pub_key == NULL)) { in do_dh_print()
[all …]
H A Ddh_lib.c162 BN_clear_free(r->pub_key); in DH_free()
259 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
261 if (pub_key != NULL) in DH_get0_key()
262 *pub_key = dh->pub_key; in DH_get0_key()
267 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
269 if (pub_key != NULL) { in DH_set0_key()
270 BN_clear_free(dh->pub_key); in DH_set0_key()
271 dh->pub_key = pub_key; in DH_set0_key()
304 return dh->pub_key; in DH_get0_pub_key()
H A Ddh_backend.c62 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dh_key_fromdata() local
76 && !OSSL_PARAM_get_BN(param_pub_key, &pub_key)) in ossl_dh_key_fromdata()
79 if (!DH_set0_key(dh, pub_key, priv_key)) in ossl_dh_key_fromdata()
86 BN_free(pub_key); in ossl_dh_key_fromdata()
158 || !dh_bn_dup_check(&dupkey->pub_key, dh->pub_key))) in ossl_dh_dup()
/freebsd/crypto/libecc/include/libecc/sig/
H A Dec_key.h135 #define EC_PUB_KEY_EXPORT_SIZE(pub_key) \ argument
136 (3 * BYTECEIL((pub_key)->params->ec_curve.a.ctx->p_bitlen))
142 #define EC_STRUCTURED_PUB_KEY_EXPORT_SIZE(pub_key) \ argument
143 ((u8)(EC_PUB_KEY_EXPORT_SIZE(pub_key) + (u8)(3 * sizeof(u8))))
149 ATTRIBUTE_WARN_UNUSED_RET int ec_pub_key_import_from_buf(ec_pub_key *pub_key, const ec_params *para…
152 ATTRIBUTE_WARN_UNUSED_RET int ec_pub_key_export_to_buf(const ec_pub_key *pub_key, u8 *pub_key_buf,
155 ATTRIBUTE_WARN_UNUSED_RET int ec_pub_key_import_from_aff_buf(ec_pub_key *pub_key, const ec_params *…
159 ATTRIBUTE_WARN_UNUSED_RET int ec_pub_key_export_to_aff_buf(const ec_pub_key *pub_key, u8 *pub_key_b…
162 ATTRIBUTE_WARN_UNUSED_RET int ec_structured_pub_key_import_from_buf(ec_pub_key *pub_key,
167 ATTRIBUTE_WARN_UNUSED_RET int ec_structured_pub_key_export_to_buf(const ec_pub_key *pub_key,
[all …]
/freebsd/crypto/openssl/util/perl/TLSProxy/
H A DServerKeyExchange.pm43 $self->{pub_key} = "";
73 my $pub_key = substr($self->data, $ptr, $pub_key_len);
96 $self->pub_key($pub_key);
112 $data .= pack('n', length($self->pub_key));
113 $data .= $self->pub_key;
141 sub pub_key subroutine
145 $self->{pub_key} = shift;
147 return $self->{pub_key};
/freebsd/crypto/openssl/crypto/ffc/
H A Dffc_key_validate.c20 const BIGNUM *pub_key, int *ret) in ossl_ffc_validate_public_key_partial() argument
27 if (params == NULL || pub_key == NULL || params->p == NULL) { in ossl_ffc_validate_public_key_partial()
42 if (BN_cmp(pub_key, tmp) <= 0) in ossl_ffc_validate_public_key_partial()
48 if (BN_cmp(pub_key, tmp) >= 0) in ossl_ffc_validate_public_key_partial()
63 const BIGNUM *pub_key, int *ret) in ossl_ffc_validate_public_key() argument
69 if (!ossl_ffc_validate_public_key_partial(params, pub_key, ret)) in ossl_ffc_validate_public_key()
81 || !BN_mod_exp(tmp, pub_key, params->q, params->p, ctx)) in ossl_ffc_validate_public_key()
/freebsd/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()
/freebsd/crypto/openssl/apps/
H A Dtestdsa.h1438 BIGNUM *priv_key, *pub_key, *p, *q, *g; in get_dsa() local
1462 pub_key = BN_bin2bn(dsa_t.pub, dsa_t.pub_l, NULL); in get_dsa()
1466 if (priv_key == NULL || pub_key == NULL || p == NULL || q == NULL in get_dsa()
1480 pub_key) in get_dsa()
1493 BN_free(pub_key); in get_dsa()
/freebsd/contrib/ntp/libntp/
H A 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/crypto/libecc/src/tests/
H A Dec_self_tests_core.c77 pub_key_buf_len = EC_STRUCTURED_PUB_KEY_EXPORT_SIZE(&(kp->pub_key)); in ec_gen_import_export_kp()
81 ret = ec_structured_pub_key_export_to_buf(&(kp->pub_key), pub_key_buf, in ec_gen_import_export_kp()
96 ret = ec_structured_pub_key_import_from_buf(&(imported_kp.pub_key), in ec_gen_import_export_kp()
173 …N_UNUSED_RET static int random_split_ec_verify(const u8 *sig, u8 siglen, const ec_pub_key *pub_key, in random_split_ec_verify() argument
183 ret = ec_verify_init(&ctx, pub_key, sig, siglen, sig_type, hash_type, adata, adata_len); in random_split_ec_verify()
336 ret = ec_verify(sig, siglen, &(kp.pub_key), msg, msglen, in ec_import_export_test()
347 ret = ec_verify(sig_tmp2, siglen, &(kp.pub_key), msg, msglen, in ec_import_export_test()
351 ret = ec_verify(sig, siglen, &(kp.pub_key), msg, msglen, in ec_import_export_test()
360 ret = random_split_ec_verify(sig_tmp1, siglen, &(kp.pub_key), msg, msglen, in ec_import_export_test()
364 ret = random_split_ec_verify(sig, siglen, &(kp.pub_key), msg, msglen, in ec_import_export_test()
[all …]

1234