diff options
author | Rasmus Dahlberg <rasmus@mullvad.net> | 2022-05-21 20:31:09 +0200 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@mullvad.net> | 2022-06-21 19:46:54 +0200 |
commit | 8d097316c0a12f14de4b9e27e1fe4c458c32f4b0 (patch) | |
tree | 84ff3998b167bb5e12f26842ddff2c565c7a86bb /internal/fmtio | |
parent | 97540f9ded30f68f9fda62f66f3006414cbfd5b7 (diff) |
use hashing from merkle package
Diffstat (limited to 'internal/fmtio')
-rw-r--r-- | internal/fmtio/fmtio.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/fmtio/fmtio.go b/internal/fmtio/fmtio.go index f900e42..84b1265 100644 --- a/internal/fmtio/fmtio.go +++ b/internal/fmtio/fmtio.go @@ -10,6 +10,7 @@ import ( "os" "git.sigsum.org/sigsum-go/pkg/hex" + "git.sigsum.org/sigsum-go/pkg/merkle" "git.sigsum.org/sigsum-go/pkg/types" ) @@ -54,12 +55,12 @@ func PublicKeyFromHex(s string) (pub types.PublicKey, err error) { return } -func KeyHashFromHex(s string) (h types.Hash, err error) { +func KeyHashFromHex(s string) (h merkle.Hash, err error) { b, err := hex.Deserialize(s) if err != nil { return h, err } - if n := len(b); n != types.HashSize { + if n := len(b); n != merkle.HashSize { return h, fmt.Errorf("invalid size %d", n) } copy(h[:], b) |