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 /pkg/requests/requests.go | |
parent | 97540f9ded30f68f9fda62f66f3006414cbfd5b7 (diff) |
use hashing from merkle package
Diffstat (limited to 'pkg/requests/requests.go')
-rw-r--r-- | pkg/requests/requests.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/requests/requests.go b/pkg/requests/requests.go index 7d7437d..6b74184 100644 --- a/pkg/requests/requests.go +++ b/pkg/requests/requests.go @@ -8,12 +8,13 @@ import ( "git.sigsum.org/sigsum-go/pkg/ascii" "git.sigsum.org/sigsum-go/pkg/hex" + "git.sigsum.org/sigsum-go/pkg/merkle" "git.sigsum.org/sigsum-go/pkg/types" ) type Leaf struct { ShardHint uint64 `ascii:"shard_hint"` - Message types.Hash `ascii:"message"` + Message merkle.Hash `ascii:"message"` Signature types.Signature `ascii:"signature"` PublicKey types.PublicKey `ascii:"public_key"` DomainHint string `ascii:"domain_hint"` @@ -26,7 +27,7 @@ type Leaves struct { type InclusionProof struct { TreeSize uint64 - LeafHash types.Hash + LeafHash merkle.Hash } type ConsistencyProof struct { @@ -36,7 +37,7 @@ type ConsistencyProof struct { type Cosignature struct { Cosignature types.Signature `ascii:"cosignature"` - KeyHash types.Hash `ascii:"key_hash"` + KeyHash merkle.Hash `ascii:"key_hash"` } func (req *Leaf) ToASCII(w io.Writer) error { @@ -97,7 +98,7 @@ func (req *InclusionProof) FromURL(url string) (err error) { if err != nil { return err } - if n := len(b); n != types.HashSize { + if n := len(b); n != merkle.HashSize { return fmt.Errorf("invalid hash size %d", n) } copy(req.LeafHash[:], b) |