From 1ac7f1bad7596bc0cc489d85de8bdf5d195b99a3 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Mon, 31 May 2021 23:56:49 +0200 Subject: added types and fixed an error - The wrong signature header was used for leaves - Added SigIdent marshalling - Added a wrapper that uses the log's hash function --- types/util.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 types/util.go (limited to 'types/util.go') diff --git a/types/util.go b/types/util.go new file mode 100644 index 0000000..dc8ccba --- /dev/null +++ b/types/util.go @@ -0,0 +1,13 @@ +package types + +import ( + "crypto/sha256" +) + +func Hash(buf []byte) *[HashSize]byte { + var ret [HashSize]byte + hash := sha256.New() + hash.Write(buf) + copy(ret[:], hash.Sum(nil)) + return &ret +} -- cgit v1.2.3