Home
last modified time | relevance | path

Searched refs:saltlen (Results 1 – 25 of 75) sorted by relevance

123

/freebsd/crypto/openssl/crypto/asn1/
H A Dp5_pbe.c28 const unsigned char *salt, int saltlen,
46 if (!saltlen)
47 saltlen = PKCS5_SALT_LEN;
48 if (saltlen < 0)
51 sstr = OPENSSL_malloc(saltlen);
57 memcpy(sstr, salt, saltlen);
58 else if (RAND_bytes_ex(ctx, sstr, saltlen, 0) <= 0)
61 ASN1_STRING_set0(pbe->salt, sstr, saltlen);
83 const unsigned char *salt, int saltlen) in PKCS5_pbe_set0_algor() argument
85 return PKCS5_pbe_set0_algor_ex(algor, alg, iter, salt, saltlen, NULL); in PKCS5_pbe_set0_algor()
[all …]
H A Dp5_pbev2.c43 unsigned char *salt, int saltlen,
112 pbe2->keyfunc = PKCS5_pbkdf2_set_ex(iter, salt, saltlen, prf_nid, keylen,
149 unsigned char *salt, int saltlen, in PKCS5_pbe2_set_iv() argument
152 return PKCS5_pbe2_set_iv_ex(cipher, iter, salt, saltlen, aiv, prf_nid, in PKCS5_pbe2_set_iv()
157 unsigned char *salt, int saltlen) in PKCS5_pbe2_set() argument
159 return PKCS5_pbe2_set_iv_ex(cipher, iter, salt, saltlen, NULL, -1, in PKCS5_pbe2_set()
164 X509_ALGOR *PKCS5_pbkdf2_set_ex(int iter, unsigned char *salt, int saltlen, in PKCS5_pbkdf2_set_ex() argument
180 if (saltlen < 0) in PKCS5_pbkdf2_set_ex()
182 if (saltlen == 0) in PKCS5_pbkdf2_set_ex()
183 saltlen = PKCS5_SALT_LEN; in PKCS5_pbkdf2_set_ex()
[all …]
H A Dp5_scrypt.c33 static X509_ALGOR *pkcs5_scrypt_set(const unsigned char *salt, size_t saltlen,
42 const unsigned char *salt, int saltlen, in PKCS5_pbe2_set_scrypt() argument
112 pbe2->keyfunc = pkcs5_scrypt_set(salt, saltlen, keylen, N, r, p); in PKCS5_pbe2_set_scrypt()
147 static X509_ALGOR *pkcs5_scrypt_set(const unsigned char *salt, size_t saltlen, in pkcs5_scrypt_set() argument
157 if (!saltlen) in pkcs5_scrypt_set()
158 saltlen = PKCS5_SALT_LEN; in pkcs5_scrypt_set()
161 if (ASN1_STRING_set(sparam->salt, salt, saltlen) == 0) in pkcs5_scrypt_set()
164 if (salt == NULL && RAND_bytes(sparam->salt->data, saltlen) <= 0) in pkcs5_scrypt_set()
218 size_t saltlen; in PKCS5_v2_scrypt_keyivgen_ex() local
267 saltlen = sparam->salt->length; in PKCS5_v2_scrypt_keyivgen_ex()
[all …]
/freebsd/crypto/openssl/crypto/pkcs12/
H A Dp12_key.c20 int saltlen, int id, int iter, int n, in PKCS12_key_gen_asc_ex() argument
35 ret = PKCS12_key_gen_uni_ex(unipass, uniplen, salt, saltlen, id, iter, in PKCS12_key_gen_asc_ex()
42 int saltlen, int id, int iter, int n, in PKCS12_key_gen_asc() argument
45 return PKCS12_key_gen_asc_ex(pass, passlen, salt, saltlen, id, iter, n, in PKCS12_key_gen_asc()
50 int saltlen, int id, int iter, int n, in PKCS12_key_gen_utf8_ex() argument
65 ret = PKCS12_key_gen_uni_ex(unipass, uniplen, salt, saltlen, id, iter, in PKCS12_key_gen_utf8_ex()
72 int saltlen, int id, int iter, int n, in PKCS12_key_gen_utf8() argument
75 return PKCS12_key_gen_utf8_ex(pass, passlen, salt, saltlen, id, iter, n, in PKCS12_key_gen_utf8()
80 int saltlen, int id, int iter, int n, in PKCS12_key_gen_uni_ex() argument
106 salt, saltlen); in PKCS12_key_gen_uni_ex()
[all …]
H A Dp12_mutl.c56 const unsigned char *salt, int saltlen, in pkcs12_gen_gost_mac_key() argument
66 if (!PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter, in pkcs12_gen_gost_mac_key()
89 int saltlen, iter; in pkcs12_gen_mac() local
107 saltlen = p12->mac->salt->length; in pkcs12_gen_mac()
139 if (!pkcs12_gen_gost_mac_key(pass, passlen, salt, saltlen, iter, in pkcs12_gen_mac()
146 if (!(*pkcs12_key_gen)(pass, passlen, salt, saltlen, PKCS12_MAC_ID, in pkcs12_gen_mac()
153 if (!PKCS12_key_gen_utf8_ex(pass, passlen, salt, saltlen, PKCS12_MAC_ID, in pkcs12_gen_mac()
210 unsigned char *salt, int saltlen, int iter, in PKCS12_set_mac() argument
222 if (PKCS12_setup_mac(p12, iter, salt, saltlen, md_type) == PKCS12_ERROR) { in PKCS12_set_mac()
242 int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, in PKCS12_setup_mac() argument
[all …]
H A Dp12_p8e.c18 unsigned char *salt, int saltlen, int iter, in PKCS8_encrypt_ex() argument
30 pbe = PKCS5_pbe2_set_iv_ex(cipher, iter, salt, saltlen, NULL, -1, in PKCS8_encrypt_ex()
40 pbe = PKCS5_pbe2_set_iv_ex(cipher, iter, salt, saltlen, NULL, in PKCS8_encrypt_ex()
44 pbe = PKCS5_pbe_set_ex(pbe_nid, iter, salt, saltlen, libctx); in PKCS8_encrypt_ex()
62 unsigned char *salt, int saltlen, int iter, in PKCS8_encrypt() argument
65 return PKCS8_encrypt_ex(pbe_nid, cipher, pass, passlen, salt, saltlen, iter, in PKCS8_encrypt()
H A Dp12_crpt.c29 int saltlen, iter, ret; in PKCS12_PBE_keyivgen_ex() local
50 saltlen = pbe->salt->length; in PKCS12_PBE_keyivgen_ex()
51 if (!PKCS12_key_gen_utf8_ex(pass, passlen, salt, saltlen, PKCS12_KEY_ID, in PKCS12_PBE_keyivgen_ex()
60 if (!PKCS12_key_gen_utf8_ex(pass, passlen, salt, saltlen, PKCS12_IV_ID, in PKCS12_PBE_keyivgen_ex()
H A Dp12_add.c93 unsigned char *salt, int saltlen, int iter, in PKCS12_pack_p7encdata_ex() argument
118 pbe = PKCS5_pbe2_set_iv_ex(pbe_ciph, iter, salt, saltlen, NULL, -1, ctx); in PKCS12_pack_p7encdata_ex()
120 pbe = PKCS5_pbe_set_ex(pbe_nid, iter, salt, saltlen, ctx); in PKCS12_pack_p7encdata_ex()
147 unsigned char *salt, int saltlen, int iter, in PKCS12_pack_p7encdata() argument
150 return PKCS12_pack_p7encdata_ex(pbe_nid, pass, passlen, salt, saltlen, in PKCS12_pack_p7encdata()
/freebsd/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/
H A Dcrypto_scrypt-common.c146 size_t saltlen; in escrypt_r() local
163 saltlen = src - salt; in escrypt_r()
165 saltlen = strlen((char *) salt); in escrypt_r()
167 need = prefixlen + saltlen + 1 + in escrypt_r()
169 if (need > buflen || need < saltlen) { in escrypt_r()
178 if (escrypt_kdf(local, passwd, passwdlen, salt, saltlen, N, r, p, hash, in escrypt_r()
183 memcpy(dst, setting, prefixlen + saltlen); in escrypt_r()
184 dst += prefixlen + saltlen; in escrypt_r()
204 size_t saltlen = BYTES2CHARS(srclen); in escrypt_gensalt_r() local
207 need = prefixlen + saltlen + 1; in escrypt_gensalt_r()
[all …]
/freebsd/crypto/openssh/openbsd-compat/
H A Dbcrypt_pbkdf.c114 bcrypt_pbkdf(const char *pass, size_t passlen, const uint8_t *salt, size_t saltlen, in bcrypt_pbkdf() argument
129 if (passlen == 0 || saltlen == 0 || keylen == 0 || in bcrypt_pbkdf()
130 keylen > sizeof(out) * sizeof(out) || saltlen > 1<<20) in bcrypt_pbkdf()
132 if ((countsalt = calloc(1, saltlen + 4)) == NULL) in bcrypt_pbkdf()
137 memcpy(countsalt, salt, saltlen); in bcrypt_pbkdf()
144 countsalt[saltlen + 0] = (count >> 24) & 0xff; in bcrypt_pbkdf()
145 countsalt[saltlen + 1] = (count >> 16) & 0xff; in bcrypt_pbkdf()
146 countsalt[saltlen + 2] = (count >> 8) & 0xff; in bcrypt_pbkdf()
147 countsalt[saltlen + 3] = count & 0xff; in bcrypt_pbkdf()
150 crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); in bcrypt_pbkdf()
[all …]
/freebsd/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/
H A Dargon2.c88 const void *salt, const size_t saltlen, void *hash, in argon2_hash() argument
104 if (saltlen > ARGON2_MAX_SALT_LENGTH) { in argon2_hash()
118 context.saltlen = (uint32_t) saltlen; in argon2_hash()
162 const size_t saltlen, const size_t hashlen, char *encoded, in argon2i_hash_encoded() argument
165 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2i_hash_encoded()
172 const size_t pwdlen, const void *salt, const size_t saltlen, in argon2i_hash_raw() argument
175 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2i_hash_raw()
183 const size_t saltlen, const size_t hashlen, char *encoded, in argon2id_hash_encoded() argument
186 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2id_hash_encoded()
193 const size_t pwdlen, const void *salt, const size_t saltlen, in argon2id_hash_raw() argument
[all …]
H A Dargon2.h171 uint32_t saltlen; /* salt length */ member
215 const size_t saltlen, const size_t hashlen,
236 const size_t saltlen, const size_t hashlen,
256 const size_t saltlen, void *hash, const size_t hashlen);
275 const size_t saltlen, void *hash, const size_t hashlen);
280 const size_t pwdlen, const void *salt, const size_t saltlen,
H A Dargon2-encoding.c155 size_t maxsaltlen = ctx->saltlen; in decode_string()
160 ctx->saltlen = 0; in decode_string()
193 BIN(ctx->salt, maxsaltlen, ctx->saltlen); in decode_string()
296 SB(ctx->salt, ctx->saltlen); in encode_string()
/freebsd/crypto/openssl/providers/implementations/signature/
H A Drsa_sig.c103 int saltlen; member
193 prsactx->saltlen = RSA_PSS_SALTLEN_AUTO; in rsa_newctx()
200 int saltlen = ctx->saltlen; in rsa_pss_compute_saltlen() local
202 if (saltlen == RSA_PSS_SALTLEN_DIGEST) { in rsa_pss_compute_saltlen()
203 saltlen = EVP_MD_get_size(ctx->md); in rsa_pss_compute_saltlen()
204 } else if (saltlen == RSA_PSS_SALTLEN_AUTO || saltlen == RSA_PSS_SALTLEN_MAX) { in rsa_pss_compute_saltlen()
205 saltlen = RSA_size(ctx->rsa) - EVP_MD_get_size(ctx->md) - 2; in rsa_pss_compute_saltlen()
207 saltlen--; in rsa_pss_compute_saltlen()
209 if (saltlen < 0) { in rsa_pss_compute_saltlen()
212 } else if (saltlen < ctx->min_saltlen) { in rsa_pss_compute_saltlen()
[all …]
/freebsd/crypto/openssl/crypto/evp/
H A Dp5_crpt2.c23 const unsigned char *salt, int saltlen, int iter, in ossl_pkcs5_pbkdf2_hmac_ex() argument
41 if (salt == NULL && saltlen == 0) in ossl_pkcs5_pbkdf2_hmac_ex()
55 (unsigned char *)salt, saltlen); in ossl_pkcs5_pbkdf2_hmac_ex()
72 0, saltlen, salt, saltlen); in ossl_pkcs5_pbkdf2_hmac_ex()
84 int saltlen, int iter, const EVP_MD *digest, int keylen, in PKCS5_PBKDF2_HMAC() argument
87 return ossl_pkcs5_pbkdf2_hmac_ex(pass, passlen, salt, saltlen, iter, digest, in PKCS5_PBKDF2_HMAC()
93 const unsigned char *salt, int saltlen, int iter, in PKCS5_PBKDF2_HMAC_SHA1() argument
100 r = ossl_pkcs5_pbkdf2_hmac_ex(pass, passlen, salt, saltlen, iter, in PKCS5_PBKDF2_HMAC_SHA1()
186 int saltlen, iter, t; in PKCS5_v2_PBKDF2_keyivgen_ex() local
252 saltlen = kdf->salt->value.octet_string->length; in PKCS5_v2_PBKDF2_keyivgen_ex()
[all …]
H A Dpbe_scrypt.c38 const unsigned char *salt, size_t saltlen, in EVP_PBE_scrypt_ex() argument
61 saltlen = 0; in EVP_PBE_scrypt_ex()
77 (unsigned char *)salt, saltlen); in EVP_PBE_scrypt_ex()
91 const unsigned char *salt, size_t saltlen, in EVP_PBE_scrypt() argument
95 return EVP_PBE_scrypt_ex(pass, passlen, salt, saltlen, N, r, p, maxmem, in EVP_PBE_scrypt()
/freebsd/crypto/openssl/crypto/rsa/
H A Drsa_ameth.c455 int saltlen; in rsa_ctx_to_pss() local
461 if (EVP_PKEY_CTX_get_rsa_pss_saltlen(pkctx, &saltlen) <= 0) in rsa_ctx_to_pss()
463 if (saltlen == -1) { in rsa_ctx_to_pss()
464 saltlen = EVP_MD_get_size(sigmd); in rsa_ctx_to_pss()
465 } else if (saltlen == -2 || saltlen == -3) { in rsa_ctx_to_pss()
466 saltlen = EVP_PKEY_get_size(pk) - EVP_MD_get_size(sigmd) - 2; in rsa_ctx_to_pss()
468 saltlen--; in rsa_ctx_to_pss()
469 if (saltlen < 0) in rsa_ctx_to_pss()
473 return ossl_rsa_pss_params_create(sigmd, mgf1md, saltlen); in rsa_ctx_to_pss()
477 const EVP_MD *mgf1md, int saltlen) in ossl_rsa_pss_params_create() argument
[all …]
H A Drsa_pmeth.c47 int saltlen; member
73 rctx->saltlen = RSA_PSS_SALTLEN_AUTO; in pkey_rsa_init()
99 dctx->saltlen = sctx->saltlen; in pkey_rsa_copy()
187 rctx->saltlen)) in pkey_rsa_sign()
289 rctx->tbuf, rctx->saltlen); in pkey_rsa_verify()
470 *(int *)p2 = rctx->saltlen; in pkey_rsa_ctrl()
487 rctx->saltlen = p1; in pkey_rsa_ctrl()
650 int saltlen; in pkey_rsa_ctrl_str() local
653 saltlen = RSA_PSS_SALTLEN_DIGEST; in pkey_rsa_ctrl_str()
655 saltlen = RSA_PSS_SALTLEN_MAX; in pkey_rsa_ctrl_str()
[all …]
H A Drsa_backend.c178 int saltlen = ossl_rsa_pss_params_30_saltlen(pss); in ossl_rsa_pss_params_30_todata() local
210 || (!ossl_param_build_set_int(bld, params, key_saltlen, saltlen))) in ossl_rsa_pss_params_30_todata()
225 int saltlen; in ossl_rsa_pss_params_30_fromdata() local
306 if (!OSSL_PARAM_get_int(param_saltlen, &saltlen) in ossl_rsa_pss_params_30_fromdata()
307 || !ossl_rsa_pss_params_30_set_saltlen(pss_params, saltlen)) in ossl_rsa_pss_params_30_fromdata()
463 int md_nid, mgf1md_nid, saltlen, trailerField; in ossl_rsa_sync_to_pss_params_30() local
476 &saltlen, &trailerField)) in ossl_rsa_sync_to_pss_params_30()
484 || !ossl_rsa_pss_params_30_set_saltlen(&pss_params, saltlen) in ossl_rsa_sync_to_pss_params_30()
/freebsd/crypto/openssl/doc/man3/
H A DPKCS5_PBE_keyivgen.pod32 const unsigned char *salt, size_t saltlen,
36 const unsigned char *salt, size_t saltlen,
51 const unsigned char *salt, int saltlen);
53 const unsigned char *salt, int saltlen,
57 const unsigned char *salt, int saltlen);
59 const unsigned char *salt, int saltlen,
63 unsigned char *salt, int saltlen);
65 unsigned char *salt, int saltlen,
68 unsigned char *salt, int saltlen,
72 const unsigned char *salt, int saltlen,
[all …]
H A DPKCS12_key_gen_utf8_ex.pod14 int saltlen, int id, int iter, int n,
17 int saltlen, int id, int iter, int n,
21 int saltlen, int id, int iter, int n,
24 int saltlen, int id, int iter, int n,
28 int saltlen, int id, int iter, int n,
31 int saltlen, int id, int iter, int n,
39 I<saltlen>, an iteration count I<iter> and a digest algorithm I<md_type>.
83 I<salt> is the salt used in the derivation of length I<saltlen>. If the
84 I<salt> is NULL, then I<saltlen> must be 0. The function will not
/freebsd/crypto/openssl/include/openssl/
H A Dpkcs12.h149 int saltlen, int iter,
155 int saltlen, int iter,
175 int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
178 int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8,
188 unsigned char *salt, int saltlen, int iter,
191 unsigned char *salt, int saltlen, int iter,
254 int saltlen, int id, int iter, int n,
257 int saltlen, int id, int iter, int n,
261 int saltlen, int id, int iter, int n,
264 int saltlen, int id, int iter, int n,
[all …]
H A Dpkcs12.h.in126 int saltlen, int iter,
132 int saltlen, int iter,
152 int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
155 int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8,
165 unsigned char *salt, int saltlen, int iter,
168 unsigned char *salt, int saltlen, int iter,
231 int saltlen, int id, int iter, int n,
234 int saltlen, int id, int iter, int n,
238 int saltlen, int id, int iter, int n,
241 int saltlen, int id, int iter, int n,
[all …]
/freebsd/contrib/unbound/validator/
H A Dval_nsec3.c202 uint8_t** salt, size_t* saltlen) in nsec3_get_salt() argument
209 *saltlen = 0; in nsec3_get_salt()
212 *saltlen = (size_t)d->rr_data[r][2+4]; in nsec3_get_salt()
213 if(d->rr_len[r] < 2+5+(size_t)*saltlen) { in nsec3_get_salt()
215 *saltlen = 0; in nsec3_get_salt()
223 int* algo, size_t* iter, uint8_t** salt, size_t* saltlen) in nsec3_get_params() argument
227 if(!nsec3_get_salt(rrset, r, salt, saltlen)) in nsec3_get_params()
238 size_t saltlen; in nsec3_get_nextowner() local
247 saltlen = (size_t)d->rr_data[r][2+4]; in nsec3_get_nextowner()
248 if(d->rr_len[r] < 2+5+saltlen+1) { in nsec3_get_nextowner()
[all …]
/freebsd/crypto/openssl/providers/common/der/
H A Dder_rsa_key.c287 int saltlen, default_saltlen; in ossl_DER_w_RSASSA_PSS_params() local
305 saltlen = ossl_rsa_pss_params_30_saltlen(pss); in ossl_DER_w_RSASSA_PSS_params()
308 if (saltlen < 0) { in ossl_DER_w_RSASSA_PSS_params()
351 && (saltlen == default_saltlen || ossl_DER_w_uint32(pkt, 2, (uint32_t)saltlen)) in ossl_DER_w_RSASSA_PSS_params()

123