aboutsummaryrefslogtreecommitdiff
path: root/cmd/sigsum-debug/hashleaf/hashleaf.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@mullvad.net>2022-04-23 18:44:09 +0200
committerRasmus Dahlberg <rasmus@mullvad.net>2022-04-23 18:44:09 +0200
commitcc9bb6a069d62ed37b7f4866d6dfe37049dc1cf1 (patch)
tree3dc49efe0e0690656897dc8562da6b7cbc41c9ea /cmd/sigsum-debug/hashleaf/hashleaf.go
parent2c28b4209be2ced9a18c20347e1819a24a45cb66 (diff)
remove sigsum-debug (pending merge in sigsum-go)HEADmain
Diffstat (limited to 'cmd/sigsum-debug/hashleaf/hashleaf.go')
-rw-r--r--cmd/sigsum-debug/hashleaf/hashleaf.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/cmd/sigsum-debug/hashleaf/hashleaf.go b/cmd/sigsum-debug/hashleaf/hashleaf.go
deleted file mode 100644
index 0f5d3e3..0000000
--- a/cmd/sigsum-debug/hashleaf/hashleaf.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package hashleaf
-
-import (
- "crypto/ed25519"
- "fmt"
-
- "git.sigsum.org/sigsum-go/pkg/hex"
- "git.sigsum.org/sigsum-go/pkg/types"
- "git.sigsum.org/sigsum-tools-go/internal/util"
-)
-
-func Main(_ []string, optPriv string, optShardHint uint64) error {
- data, err := util.BytesFromStdin()
- if err != nil {
- return fmt.Errorf("sign: %v", err)
- }
- priv, err := util.SignerFromHex(optPriv)
- if err != nil {
- return fmt.Errorf("sign: %v", err)
- }
- preimage := types.HashFn(data)
- stm := types.Statement{
- ShardHint: optShardHint,
- Checksum: *types.HashFn(preimage[:]),
- }
- sig, err := stm.Sign(priv)
- if err != nil {
- fmt.Errorf("sign: %v", err)
- }
- leaf := types.Leaf{
- Statement: stm,
- Signature: *sig,
- KeyHash: *types.HashFn(priv.Public().(ed25519.PublicKey)[:]),
- }
- lh := types.LeafHash(leaf.ToBinary())
-
- fmt.Printf("%s\n", hex.Serialize(lh[:]))
- return nil
-}