Home
last modified time | relevance | path

Searched refs:pub_key (Results 1 – 25 of 75) 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.c163 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key) in DH_check_pub_key_ex() argument
167 if (!DH_check_pub_key(dh, pub_key, &errflags)) in DH_check_pub_key_ex()
180 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret) in DH_check_pub_key() argument
194 if (BN_cmp(pub_key, tmp) <= 0) in DH_check_pub_key()
198 if (BN_cmp(pub_key, tmp) >= 0) in DH_check_pub_key()
203 if (!BN_mod_exp(tmp, pub_key, dh->q, dh->p, ctx)) in DH_check_pub_key()
/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()
/third_party/boringssl/src/crypto/fipsmodule/ec/
Dec_key.c172 EC_POINT_free(r->pub_key); in EC_KEY_free()
194 (src->pub_key != NULL && in EC_KEY_dup()
195 !EC_KEY_set_public_key(ret, src->pub_key)) || in EC_KEY_dup()
229 assert(key->pub_key == NULL); in EC_KEY_set_group()
261 return key->pub_key; in EC_KEY_get0_public_key()
264 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub_key) { in EC_KEY_set_public_key() argument
270 if (pub_key != NULL && EC_GROUP_cmp(key->group, pub_key->group, NULL) != 0) { in EC_KEY_set_public_key()
275 EC_POINT_free(key->pub_key); in EC_KEY_set_public_key()
276 key->pub_key = EC_POINT_dup(pub_key, key->group); in EC_KEY_set_public_key()
277 return (key->pub_key == NULL) ? 0 : 1; in EC_KEY_set_public_key()
[all …]
/third_party/boringssl/src/crypto/dh/
Ddh.c110 BN_clear_free(dh->pub_key); in DH_free()
120 *out_pub_key = dh->pub_key; in DH_get0_key()
127 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) { in DH_set0_key() argument
128 if (pub_key != NULL) { in DH_set0_key()
129 BN_free(dh->pub_key); in DH_set0_key()
130 dh->pub_key = pub_key; in DH_set0_key()
296 BIGNUM *pub_key = NULL, *priv_key = NULL; in DH_generate_key() local
318 if (dh->pub_key == NULL) { in DH_generate_key()
319 pub_key = BN_new(); in DH_generate_key()
320 if (pub_key == NULL) { in DH_generate_key()
[all …]
Ddh_test.cc158 BN_print_fp(stdout, a->pub_key); in RunBasicTests()
167 BN_print_fp(stdout, b->pub_key); in RunBasicTests()
171 int ret = DH_compute_key(key1.data(), b->pub_key, a.get()); in RunBasicTests()
184 ret = DH_compute_key(key2.data(), a->pub_key, b.get()); in RunBasicTests()
296 bssl::UniquePtr<BIGNUM> pub_key( in TestBadY() local
298 if (!dh || !pub_key || !DH_generate_key(dh.get())) { in TestBadY()
303 if (!DH_check_pub_key(dh.get(), pub_key.get(), &flags)) { in TestBadY()
312 if (DH_compute_key(result.data(), pub_key.get(), dh.get()) >= 0) { in TestBadY()
Dcheck.c62 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *out_flags) { in DH_check_pub_key() argument
79 if (BN_cmp(pub_key, tmp) <= 0) { in DH_check_pub_key()
88 if (BN_cmp(pub_key, tmp) >= 0) { in DH_check_pub_key()
96 if (!BN_mod_exp_mont(tmp, pub_key, dh->q, dh->p, ctx, NULL)) { in DH_check_pub_key()
/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/uboot/u-boot-2020.01/product/hiupdate/verify/
Dupdate_rsa.c47 rsa.pub_key.n = get_ota_pub_key_N(&rsa.pub_key.n_len); in update_sign_rsa_verify()
48 rsa.pub_key.e = get_ota_pub_key_E(&rsa.pub_key.e_len); in update_sign_rsa_verify()
49 if (!rsa.pub_key.n || !rsa.pub_key.e) { in update_sign_rsa_verify()
/third_party/boringssl/src/crypto/evp/
Dp_dsa_asn1.c85 dsa->pub_key = BN_new(); in dsa_pub_decode()
86 if (dsa->pub_key == NULL) { in dsa_pub_decode()
90 if (!BN_parse_asn1_unsigned(key, dsa->pub_key) || in dsa_pub_decode()
118 !BN_marshal_asn1(&key_bitstring, dsa->pub_key) || in dsa_pub_encode()
139 dsa->pub_key = BN_new(); in dsa_priv_decode()
140 if (dsa->priv_key == NULL || dsa->pub_key == NULL) { in dsa_priv_decode()
154 !BN_mod_exp_mont_consttime(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, in dsa_priv_decode()
241 return BN_cmp(b->pkey.dsa->pub_key, a->pkey.dsa->pub_key) == 0; in dsa_pub_cmp()
/third_party/boringssl/src/crypto/dsa/
Ddsa.c121 BN_clear_free(dsa->pub_key); in DSA_free()
137 *out_pub_key = dsa->pub_key; in DSA_get0_key()
157 int DSA_set0_key(DSA *dsa, BIGNUM *pub_key, BIGNUM *priv_key) { in DSA_set0_key() argument
158 if (dsa->pub_key == NULL && pub_key == NULL) { in DSA_set0_key()
162 if (pub_key != NULL) { in DSA_set0_key()
163 BN_free(dsa->pub_key); in DSA_set0_key()
164 dsa->pub_key = pub_key; in DSA_set0_key()
473 BIGNUM *pub_key = NULL, *priv_key = NULL; in DSA_generate_key() local
492 pub_key = dsa->pub_key; in DSA_generate_key()
493 if (pub_key == NULL) { in DSA_generate_key()
[all …]
/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/boringssl/src/crypto/fipsmodule/ecdh/
Decdh.c80 int ECDH_compute_key_fips(uint8_t *out, size_t out_len, const EC_POINT *pub_key, in ECDH_compute_key_fips() argument
88 if (EC_GROUP_cmp(group, pub_key->group, NULL) != 0) { in ECDH_compute_key_fips()
96 if (!ec_point_mul_scalar(group, &shared_point, &pub_key->raw, priv) || in ECDH_compute_key_fips()
/third_party/boringssl/src/crypto/ecdh_extra/
Decdh_extra.c80 int ECDH_compute_key(void *out, size_t out_len, const EC_POINT *pub_key, in ECDH_compute_key() argument
90 if (EC_GROUP_cmp(group, pub_key->group, NULL) != 0) { in ECDH_compute_key()
98 if (!ec_point_mul_scalar(group, &shared_point, &pub_key->raw, priv) || in ECDH_compute_key()
/third_party/openssl/include/openssl/
Ddh.h147 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key);
150 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes);
152 int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
153 int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);
184 const BIGNUM **pub_key, const BIGNUM **priv_key);
185 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
210 (unsigned char *key, const BIGNUM *pub_key, DH *dh);
212 int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh));
/third_party/boringssl/src/crypto/ec_extra/
Dec_asn1.c131 ret->pub_key = EC_POINT_new(group); in EC_KEY_parse_private_key()
132 if (priv_key == NULL || ret->pub_key == NULL || in EC_KEY_parse_private_key()
149 !EC_POINT_oct2point(group, ret->pub_key, CBS_data(&public_key), in EC_KEY_parse_private_key()
162 if (!ec_point_mul_scalar_base(group, &ret->pub_key->raw, in EC_KEY_parse_private_key()
221 if (!(enc_flags & EC_PKEY_NO_PUBKEY) && key->pub_key != NULL) { in EC_KEY_marshal_private_key()
228 !EC_POINT_point2cbb(&public_key, key->group, key->pub_key, in EC_KEY_marshal_private_key()
520 if (ret->pub_key == NULL && in o2i_ECPublicKey()
521 (ret->pub_key = EC_POINT_new(ret->group)) == NULL) { in o2i_ECPublicKey()
525 if (!EC_POINT_oct2point(ret->group, ret->pub_key, *inp, len, NULL)) { in o2i_ECPublicKey()
544 buf_len = EC_POINT_point2oct(key->group, key->pub_key, key->conv_form, NULL, in i2o_ECPublicKey()
[all …]
/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 …]

123