sha256: add sha256_direct()/SHA256_DIRECT() helpers

This commit is contained in:
Lennart Poettering
2022-08-19 12:53:04 +02:00
parent 00b4663813
commit 558d96240b
4 changed files with 14 additions and 14 deletions
+1 -3
View File
@@ -29,9 +29,7 @@ void hmac_sha256(const void *key,
/* The key needs to be block size length or less, hash it if it's longer. */
if (key_size > HMAC_BLOCK_SIZE) {
sha256_init_ctx(&hash);
sha256_process_bytes(key, key_size, &hash);
sha256_finish_ctx(&hash, replacement_key);
sha256_direct(key, key_size, replacement_key);
key = replacement_key;
key_size = SHA256_DIGEST_SIZE;
}