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

12

/freebsd-13-stable/crypto/openssl/crypto/dsa/
H A Ddsa_key.c29 BIGNUM *pub_key = NULL, *priv_key = NULL; local
34 if (dsa->priv_key == NULL) {
35 if ((priv_key = BN_secure_new()) == NULL)
38 priv_key = dsa->priv_key;
41 if (!BN_priv_rand_range(priv_key, dsa->q))
43 while (BN_is_zero(priv_key)) ;
56 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME);
62 /* We MUST free prk before any further use of priv_key */
66 dsa->priv_key
[all...]
H A Ddsa_lib.c130 BN_clear_free(r->priv_key);
189 * DSA has p, q, g, optional pub_key, optional priv_key. DH has p,
190 * optional length, g, optional pub_key, optional priv_key, optional q.
194 BIGNUM *p = NULL, *q = NULL, *g = NULL, *pub_key = NULL, *priv_key = NULL; local
218 if (r->priv_key != NULL) {
219 priv_key = BN_dup(r->priv_key);
220 if (priv_key == NULL)
223 if (!DH_set0_key(ret, pub_key, priv_key))
225 } else if (r->priv_key !
280 DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) argument
289 DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) argument
[all...]
H A Ddsa_ameth.c167 if ((dsa->priv_key = BN_secure_new()) == NULL
168 || !ASN1_INTEGER_to_BN(privkey, dsa->priv_key)) {
182 BN_set_flags(dsa->priv_key, BN_FLG_CONSTTIME);
183 if (!BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) {
210 if (!pkey->pkey.dsa || !pkey->pkey.dsa->priv_key) {
230 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dsa->priv_key, NULL);
333 const BIGNUM *priv_key, *pub_key; local
336 priv_key = x->priv_key;
338 priv_key
[all...]
H A Ddsa_local.h24 BIGNUM *priv_key; /* x private key */ member in struct:dsa_st
H A Ddsa_ossl.c75 if (dsa->priv_key == NULL) {
115 * s := k^-1 * (m + r * priv_key) mod q
119 * s := blind^-1 * k^-1 * (blind * m + blind * r * priv_key) mod q
132 /* tmp := blind * priv_key * r mod q */
133 if (!BN_mod_mul(tmp, blind, dsa->priv_key, dsa->q, ctx))
142 /* s : = (blind * priv_key * r) + (blind * m) mod q */
202 if (dsa->priv_key == NULL) {
232 if (!BN_generate_dsa_nonce(k, dsa->q, dsa->priv_key, dgst,
H A Ddsa_asn1.c83 ASN1_SIMPLE(DSA, priv_key, CBIGNUM)
/freebsd-13-stable/crypto/openssl/crypto/dh/
H A Ddh_key.c110 BIGNUM *pub_key = NULL, *priv_key = NULL; local
121 if (dh->priv_key == NULL) {
122 priv_key = BN_secure_new();
123 if (priv_key == NULL)
127 priv_key = dh->priv_key;
146 if (!BN_priv_rand_range(priv_key, dh->q))
149 while (BN_is_zero(priv_key) || BN_is_one(priv_key));
153 if (!BN_priv_rand(priv_key,
[all...]
H A Ddh_lib.c126 BN_clear_free(r->priv_key);
226 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) argument
230 if (priv_key != NULL)
231 *priv_key = dh->priv_key;
234 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) argument
240 if (priv_key != NULL) {
241 BN_clear_free(dh->priv_key);
242 dh->priv_key = priv_key;
[all...]
H A Ddh_local.h24 BIGNUM *priv_key; /* x */ member in struct:dh_st
H A Ddh_ameth.c179 if ((dh->priv_key = BN_secure_new()) == NULL
180 || !ASN1_INTEGER_to_BN(privkey, dh->priv_key)) {
224 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dh->priv_key, NULL);
271 BIGNUM *priv_key, *pub_key; local
274 priv_key = x->priv_key;
276 priv_key = NULL;
283 if (x->p == NULL || (ptype == 2 && priv_key == NULL)
301 if (!ASN1_bn_print(bp, "private-key:", priv_key, NULL, indent))
/freebsd-13-stable/crypto/openssl/crypto/ec/
H A Dec_key.c69 BN_clear_free(r->priv_key);
112 if (src->priv_key != NULL) {
113 if (dest->priv_key == NULL) {
114 dest->priv_key = BN_new();
115 if (dest->priv_key == NULL)
118 if (!BN_copy(dest->priv_key, src->priv_key))
203 BIGNUM *priv_key = NULL; local
210 if (eckey->priv_key == NULL) {
211 priv_key
418 EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv_key) argument
[all...]
H A Decdh_ossl.c44 const BIGNUM *priv_key; local
59 priv_key = EC_KEY_get0_private_key(ecdh);
60 if (priv_key == NULL) {
69 !BN_mul(x, x, priv_key, ctx)) {
73 priv_key = x;
81 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) {
H A Dec_asn1.c994 EC_PRIVATEKEY *priv_key = NULL; local
997 if ((priv_key = d2i_EC_PRIVATEKEY(NULL, &p, len)) == NULL) {
1010 if (priv_key->parameters) {
1012 ret->group = EC_GROUP_new_from_ecpkparameters(priv_key->parameters);
1014 && priv_key->parameters->type == ECPKPARAMETERS_TYPE_EXPLICIT)
1023 ret->version = priv_key->version;
1025 if (priv_key->privateKey) {
1026 ASN1_OCTET_STRING *pkey = priv_key->privateKey;
1042 if (priv_key->publicKey) {
1046 pub_oct = ASN1_STRING_get0_data(priv_key
1079 EC_PRIVATEKEY *priv_key = NULL; local
[all...]
H A Decdsa_ossl.c44 const BIGNUM *priv_key; local
50 if ((priv_key = EC_KEY_get0_private_key(eckey)) == NULL) {
91 if (!BN_generate_dsa_nonce(k, order, priv_key,
164 const BIGNUM *priv_key; local
167 priv_key = EC_KEY_get0_private_key(eckey);
173 if (priv_key == NULL) {
241 || !bn_mul_mont_fixed_top(s, s, priv_key, group->mont_data, ctx)) {
/freebsd-13-stable/crypto/openssh/openbsd-compat/
H A Dlibressl-api-compat.c198 DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) argument
202 if (priv_key != NULL)
203 *priv_key = d->priv_key;
209 DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) argument
218 if (priv_key != NULL) {
219 BN_free(d->priv_key);
220 d->priv_key = priv_key;
485 DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) argument
496 DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) argument
[all...]
H A Dopenssl-compat.h113 const BIGNUM **priv_key);
117 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
182 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key);
186 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
/freebsd-13-stable/crypto/openssh/regress/unittests/sshkey/
H A Dcommon.c156 const BIGNUM *priv_key = NULL; local
160 DSA_get0_key(k->dsa, NULL, &priv_key);
161 return priv_key;
/freebsd-13-stable/contrib/ntp/libntp/
H A Dlibssl_compat.c305 *ppriv_key = pdsa->priv_key;
312 BIGNUM * priv_key
320 replace_bn_nn(&pdsa->priv_key, priv_key);
/freebsd-13-stable/contrib/bsnmp/lib/
H A Dsnmpcrypto.c158 piv[i] = piv[i] ^ pdu->user.priv_key[8 + i];
195 if (EVP_EncryptInit(ctx, ctype, pdu->user.priv_key, iv) != 1)
228 if (EVP_DecryptInit(ctx, ctype, pdu->user.priv_key, iv) != 1 ||
308 memset(user->priv_key, 0, sizeof(user->priv_key));
331 memcpy(user->priv_key, user->auth_key, sizeof(user->priv_key));
H A Dsnmp.h149 uint8_t priv_key[SNMP_PRIV_KEY_SIZ]; member in struct:snmp_user
/freebsd-13-stable/contrib/bsnmp/snmp_usm/
H A Dusm_snmp.c204 memcpy(uuser->suser.priv_key, clone->suser.priv_key,
205 sizeof(uuser->suser.priv_key));
269 memcpy(ctx->scratch->ptr1, uuser->suser.priv_key,
270 sizeof(uuser->suser.priv_key));
271 memcpy(uuser->suser.priv_key, val->v.octetstring.octets,
367 memcpy(uuser->suser.priv_key, ctx->scratch->ptr1,
368 sizeof(uuser->suser.priv_key));
440 return (string_get(val, (char *)uuser->suser.priv_key, 0));
/freebsd-13-stable/crypto/openssl/crypto/pem/
H A Dpvkfmt.c252 BIGNUM *pbn = NULL, *qbn = NULL, *gbn = NULL, *priv_key = NULL; local
274 if (!read_lebn(&p, 20, &priv_key))
278 BN_set_flags(priv_key, BN_FLG_CONSTTIME);
287 if (!BN_mod_exp(pub_key, gbn, priv_key, pbn, ctx))
296 if (!DSA_set0_key(dsa, pub_key, priv_key))
298 pub_key = priv_key = NULL;
313 BN_free(priv_key);
494 const BIGNUM *pub_key = NULL, *priv_key = NULL; local
497 DSA_get0_key(dsa, &pub_key, &priv_key);
507 if (BN_num_bits(priv_key) > 16
584 const BIGNUM *pub_key = NULL, *priv_key = NULL; local
[all...]
/freebsd-13-stable/contrib/ntp/include/
H A Dlibssl_compat.h78 BIGNUM *priv_key);
/freebsd-13-stable/contrib/ldns/
H A Dkeys.c958 BIGNUM *p=NULL, *q=NULL, *g=NULL, *priv_key=NULL, *pub_key=NULL; local
1000 /* Private key, dsa->priv_key */
1005 priv_key = BN_bin2bn((const char unsigned*)buf, i, NULL);
1006 if (!priv_key) {
1010 /* Public key, dsa->priv_key */
1026 dsa->priv_key = priv_key;
1035 if(!DSA_set0_key(dsa, pub_key, priv_key))
1051 BN_free(priv_key);
1752 const BIGNUM *pub_key, *priv_key; local
[all...]
/freebsd-13-stable/crypto/openssl/include/openssl/
H A Ddsa.h180 const BIGNUM **pub_key, const BIGNUM **priv_key);
181 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);

Completed in 191 milliseconds

12