diff options
author | Eric Biggers <ebiggers@google.com> | 2019-07-22 19:26:23 +0300 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2019-08-13 05:33:50 +0300 |
commit | add890c9f9d2d1d79184ded72f23b37b164fc673 (patch) | |
tree | cb982f8ac59675b4435c74b10571bc75a0ceb965 /fs/verity/hash_algs.c | |
parent | 4dd893d832cf4da5409e1fecea9c4f6452a93f2b (diff) | |
download | linux-add890c9f9d2d1d79184ded72f23b37b164fc673.tar.xz |
fs-verity: add SHA-512 support
Add SHA-512 support to fs-verity. This is primarily a demonstration of
the trivial changes needed to support a new hash algorithm in fs-verity;
most users will still use SHA-256, due to the smaller space required to
store the hashes. But some users may prefer SHA-512.
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'fs/verity/hash_algs.c')
-rw-r--r-- | fs/verity/hash_algs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/verity/hash_algs.c b/fs/verity/hash_algs.c index 7df1d67742b8..31e6d7d2389a 100644 --- a/fs/verity/hash_algs.c +++ b/fs/verity/hash_algs.c @@ -17,6 +17,11 @@ struct fsverity_hash_alg fsverity_hash_algs[] = { .digest_size = SHA256_DIGEST_SIZE, .block_size = SHA256_BLOCK_SIZE, }, + [FS_VERITY_HASH_ALG_SHA512] = { + .name = "sha512", + .digest_size = SHA512_DIGEST_SIZE, + .block_size = SHA512_BLOCK_SIZE, + }, }; /** |