aboutsummaryrefslogtreecommitdiff
path: root/pkg/trillian/util.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@mullvad.net>2021-12-20 19:53:54 +0100
committerRasmus Dahlberg <rasmus@mullvad.net>2021-12-20 19:53:54 +0100
commitdda238b9fc105219f220f0ec3b341b0c81b71301 (patch)
treeedbbb787ccd1c1816edfa44caf749c8be68b7bf9 /pkg/trillian/util.go
parent5ba4a77233549819440cc41a02503f3a85213e24 (diff)
types: Start using sigsum-lib-go
This commit does not change the way in which the log behaves externally. In other words, all changes are internal and involves renaming and code restructuring. Most notably picking up the refactored sigsum-lib-go.
Diffstat (limited to 'pkg/trillian/util.go')
-rw-r--r--pkg/trillian/util.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/pkg/trillian/util.go b/pkg/trillian/util.go
deleted file mode 100644
index fbd0aea..0000000
--- a/pkg/trillian/util.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package trillian
-
-import (
- "fmt"
-
- trillian "github.com/google/trillian/types"
- sigsum "git.sigsum.org/sigsum-log-go/pkg/types"
-)
-
-func treeHeadFromLogRoot(lr *trillian.LogRootV1) *sigsum.TreeHead {
- var hash [sigsum.HashSize]byte
- th := sigsum.TreeHead{
- Timestamp: uint64(lr.TimestampNanos / 1000 / 1000 / 1000),
- TreeSize: uint64(lr.TreeSize),
- RootHash: &hash,
- }
- copy(th.RootHash[:], lr.RootHash)
- return &th
-}
-
-func nodePathFromHashes(hashes [][]byte) ([]*[sigsum.HashSize]byte, error) {
- var path []*[sigsum.HashSize]byte
- for _, hash := range hashes {
- if len(hash) != sigsum.HashSize {
- return nil, fmt.Errorf("unexpected hash length: %v", len(hash))
- }
-
- var h [sigsum.HashSize]byte
- copy(h[:], hash)
- path = append(path, &h)
- }
- return path, nil
-}