summaryrefslogtreecommitdiffstats
path: root/fs/verity/verify.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2022-12-23 12:36:30 -0800
committerEric Biggers <ebiggers@google.com>2023-01-09 19:05:56 -0800
commit579a12f78d889339488175cd9f353dba2bb8d047 (patch)
treeb5ab4ec28788a73a4be44534f080f2889bac9a06 /fs/verity/verify.c
parent9098f36b739db9a77d24b7c302dcb9d3fe987308 (diff)
downloadlinux-579a12f78d889339488175cd9f353dba2bb8d047.tar.gz
linux-579a12f78d889339488175cd9f353dba2bb8d047.tar.bz2
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.c2
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,