summaryrefslogtreecommitdiffhomepage
path: root/pkg/merkletree
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-08-31 12:50:31 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-31 12:52:21 -0700
commit911cecaa34f15d9591fa060d943c35791adca855 (patch)
tree76525e1d8f6a12f9890c0853e0308e2fb7823671 /pkg/merkletree
parentba25485d96833b3852c2fbbca508414b3b96d430 (diff)
Implement walk in gvisor verity fs
Implement walk directories in gvisor verity file system. For each step, the child dentry is verified against a verified parent root hash. PiperOrigin-RevId: 329358747
Diffstat (limited to 'pkg/merkletree')
-rw-r--r--pkg/merkletree/merkletree.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/merkletree/merkletree.go b/pkg/merkletree/merkletree.go
index 1a0477c6a..36832ec86 100644
--- a/pkg/merkletree/merkletree.go
+++ b/pkg/merkletree/merkletree.go
@@ -29,6 +29,12 @@ const (
sha256DigestSize = 32
)
+// DigestSize returns the size (in bytes) of a digest.
+// TODO(b/156980949): Allow config other hash methods (SHA384/SHA512).
+func DigestSize() int {
+ return sha256DigestSize
+}
+
// Layout defines the scale of a Merkle tree.
type Layout struct {
// blockSize is the size of a data block to be hashed.