Lines Matching defs:salt
7 * in the salt and rounds= setting must contain a valid iteration count,
214 const char *salt;
223 /* setting: $6$rounds=n$salt$ (rounds=n$ and closing $ are optional) */
226 salt = setting + 3;
229 if (strncmp(salt, "rounds=", sizeof "rounds=" - 1) == 0) {
240 * rounds as part of the salt or parse them with
245 salt += sizeof "rounds=" - 1;
246 if (!isdigit(*salt))
248 u = strtoul(salt, &end, 10);
251 salt = end+1;
262 for (i = 0; i < SALT_MAX && salt[i] && salt[i] != '$'; i++)
264 if (salt[i] == '\n' || salt[i] == ':')
268 /* B = sha(key salt key) */
271 sha512_update(&ctx, salt, slen);
275 /* A = sha(key salt repeat-B alternate-B-key) */
278 sha512_update(&ctx, salt, slen);
293 /* DS = sha(repeat-salt) */
296 sha512_update(&ctx, salt, slen);
317 /* output is $6$rounds=n$salt$hash */
319 p += sprintf(p, "$6$%s%.*s$", rounds, slen, salt);