aboutsummaryrefslogtreecommitdiff
path: root/cmd/sigsum-debug/leaf/hash/hash.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@mullvad.net>2022-05-21 20:31:09 +0200
committerRasmus Dahlberg <rasmus@mullvad.net>2022-06-21 19:46:54 +0200
commit8d097316c0a12f14de4b9e27e1fe4c458c32f4b0 (patch)
tree84ff3998b167bb5e12f26842ddff2c565c7a86bb /cmd/sigsum-debug/leaf/hash/hash.go
parent97540f9ded30f68f9fda62f66f3006414cbfd5b7 (diff)
use hashing from merkle package
Diffstat (limited to 'cmd/sigsum-debug/leaf/hash/hash.go')
-rw-r--r--cmd/sigsum-debug/leaf/hash/hash.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/sigsum-debug/leaf/hash/hash.go b/cmd/sigsum-debug/leaf/hash/hash.go
index 81531b5..4fd471c 100644
--- a/cmd/sigsum-debug/leaf/hash/hash.go
+++ b/cmd/sigsum-debug/leaf/hash/hash.go
@@ -6,6 +6,7 @@ import (
"git.sigsum.org/sigsum-go/internal/fmtio"
"git.sigsum.org/sigsum-go/pkg/hex"
+ "git.sigsum.org/sigsum-go/pkg/merkle"
"git.sigsum.org/sigsum-go/pkg/types"
)
@@ -26,16 +27,16 @@ func Main(args []string, optKeyHash, optSignature string, optShardHint uint64) e
return fmt.Errorf("parse signature: %w", err)
}
- message := types.HashFn(data)
+ message := merkle.HashFn(data)
leaf := types.Leaf{
Statement: types.Statement{
ShardHint: optShardHint,
- Checksum: *types.HashFn(message[:]),
+ Checksum: *merkle.HashFn(message[:]),
},
Signature: sig,
KeyHash: keyHash,
}
- leafHash := types.LeafHash(leaf.ToBinary())
+ leafHash := merkle.HashLeafNode(leaf.ToBinary())
fmt.Printf("%s\n", hex.Serialize(leafHash[:]))
return nil