diff options
author | Eric Biggers <ebiggers@google.com> | 2022-12-23 21:36:30 +0100 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2023-01-10 04:05:56 +0100 |
commit | 579a12f78d889339488175cd9f353dba2bb8d047 (patch) | |
tree | b5ab4ec28788a73a4be44534f080f2889bac9a06 /fs/verity/verify.c | |
parent | fsverity: simplify Merkle tree readahead size calculation (diff) | |
download | linux-579a12f78d889339488175cd9f353dba2bb8d047.tar.xz linux-579a12f78d889339488175cd9f353dba2bb8d047.zip |
fsverity: store log2(digest_size) precomputed
Add log_digestsize to struct merkle_tree_params so that it can be used
in verify.c. Also save memory by using u8 for all the log_* fields.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
Tested-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/20221223203638.41293-4-ebiggers@kernel.org
Diffstat (limited to 'fs/verity/verify.c')
-rw-r--r-- | fs/verity/verify.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/verity/verify.c b/fs/verity/verify.c index 4c57a1bd01af..d2fcb6a21ea8 100644 --- a/fs/verity/verify.c +++ b/fs/verity/verify.c @@ -35,7 +35,7 @@ static void hash_at_level(const struct merkle_tree_params *params, /* Offset of the wanted hash (in bytes) within the hash block */ *hoffset = (position & ((1 << params->log_arity) - 1)) << - (params->log_blocksize - params->log_arity); + params->log_digestsize; } static inline int cmp_hashes(const struct fsverity_info *vi, |