Lines Matching refs:salt
47 /* Define our magic string to mark salt for SHA256 "encryption" replacement. */
53 /* Maximum salt string length. */
63 crypt_sha256_r(const char *key, const char *salt, char *buffer, int buflen)
81 /* Find beginning of salt string. The prefix should normally always
83 if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0)
84 /* Skip salt prefix. */
85 salt += sizeof(sha256_salt_prefix) - 1;
87 if (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1)
89 num = salt + sizeof(sha256_rounds_prefix) - 1;
93 salt = endp + 1;
99 salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX);
108 /* The last part is the salt string. This must be at most 8
111 SHA256_Update(&ctx, salt, salt_len);
120 /* Add salt. */
121 SHA256_Update(&alt_ctx, salt, salt_len);
168 SHA256_Update(&alt_ctx, salt, salt_len);
193 /* Add salt for numbers not divisible by 3. */
224 cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
271 crypt_sha256(const char *key, const char *salt)
284 + strlen(salt) + 1 + 43 + 1);
296 return crypt_sha256_r(key, salt, buffer, buflen);
360 const char *salt;
388 "we have a short salt string but not a short password",
462 char *cp = crypt_sha256(tests2[cnt].input, tests2[cnt].salt);