aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/sigsum-debug/key/hash/hash.go4
-rw-r--r--cmd/sigsum-debug/leaf/hash/hash.go7
-rw-r--r--cmd/sigsum-debug/leaf/sign/sign.go5
3 files changed, 9 insertions, 7 deletions
diff --git a/cmd/sigsum-debug/key/hash/hash.go b/cmd/sigsum-debug/key/hash/hash.go
index 0431dfc..bb2fe58 100644
--- a/cmd/sigsum-debug/key/hash/hash.go
+++ b/cmd/sigsum-debug/key/hash/hash.go
@@ -6,7 +6,7 @@ import (
"git.sigsum.org/sigsum-go/internal/fmtio"
"git.sigsum.org/sigsum-go/pkg/hex"
- "git.sigsum.org/sigsum-go/pkg/types"
+ "git.sigsum.org/sigsum-go/pkg/merkle"
)
func Main(args []string) error {
@@ -22,7 +22,7 @@ func Main(args []string) error {
return fmt.Errorf("parse key: %w", err)
}
- keyHash := types.HashFn(pub[:])
+ keyHash := merkle.HashFn(pub[:])
fmt.Printf("%s\n", hex.Serialize(keyHash[:]))
return nil
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
diff --git a/cmd/sigsum-debug/leaf/sign/sign.go b/cmd/sigsum-debug/leaf/sign/sign.go
index 3b40c32..b371baf 100644
--- a/cmd/sigsum-debug/leaf/sign/sign.go
+++ b/cmd/sigsum-debug/leaf/sign/sign.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"
)
@@ -22,10 +23,10 @@ func Main(args []string, optPrivateKey string, optShardHint uint64) error {
return fmt.Errorf("parse private key: %w", err)
}
- message := types.HashFn(data)
+ message := merkle.HashFn(data)
stm := types.Statement{
ShardHint: optShardHint,
- Checksum: *types.HashFn(message[:]),
+ Checksum: *merkle.HashFn(message[:]),
}
sig, err := stm.Sign(priv)
if err != nil {