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/types/crypto.go | |
parent | 97540f9ded30f68f9fda62f66f3006414cbfd5b7 (diff) |
use hashing from merkle package
Diffstat (limited to 'pkg/types/crypto.go')
-rw-r--r-- | pkg/types/crypto.go | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/pkg/types/crypto.go b/pkg/types/crypto.go index df93108..8660c27 100644 --- a/pkg/types/crypto.go +++ b/pkg/types/crypto.go @@ -2,29 +2,14 @@ package types import ( "crypto/ed25519" - "crypto/sha256" ) const ( - HashSize = sha256.Size SignatureSize = ed25519.SignatureSize PublicKeySize = ed25519.PublicKeySize - - LeafNodePrefix = byte(0x00) - InteriorNodePrefix = byte(0x01) ) type ( - Hash [HashSize]byte Signature [SignatureSize]byte PublicKey [PublicKeySize]byte ) - -func HashFn(buf []byte) *Hash { - var hash Hash = sha256.Sum256(buf) - return &hash -} - -func LeafHash(buf []byte) *Hash { - return HashFn(append([]byte{LeafNodePrefix}, buf...)) -} |