From cc99c977b3fea67f7340f9caf04fc404b1521994 Mon Sep 17 00:00:00 2001 From: Gary Belvin Date: Tue, 6 Mar 2018 15:23:13 +0000 Subject: [PATCH] Unexport HashLogRoot --- crypto/data_formats.go | 4 ++-- crypto/data_formats_test.go | 4 ++-- crypto/signer.go | 2 +- crypto/signer_test.go | 2 +- crypto/verifier.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crypto/data_formats.go b/crypto/data_formats.go index 633b90d1f5..c76f7c76e4 100644 --- a/crypto/data_formats.go +++ b/crypto/data_formats.go @@ -34,10 +34,10 @@ const ( mapKeyTreeSize string = "TreeSize" ) -// HashLogRoot hashes SignedLogRoot objects using ObjectHash with +// hashLogRoot hashes SignedLogRoot objects using ObjectHash with // "RootHash", "TimestampNanos", and "TreeSize", used as keys in // a map. -func HashLogRoot(root trillian.SignedLogRoot) ([]byte, error) { +func hashLogRoot(root trillian.SignedLogRoot) ([]byte, error) { // Pull out the fields we want to hash. // Caution: use string format for int64 values as they can overflow when // JSON encoded otherwise (it uses floats). We want to be sure that people diff --git a/crypto/data_formats_test.go b/crypto/data_formats_test.go index e372b7d984..a468e983d1 100644 --- a/crypto/data_formats_test.go +++ b/crypto/data_formats_test.go @@ -32,7 +32,7 @@ func TestHashLogRootKnownValue(t *testing.T) { RootHash: []byte("Some bytes that won't change"), TreeSize: 167329345, } - hash, err := HashLogRoot(root) + hash, err := hashLogRoot(root) if err != nil { t.Fatalf("HashLogRoot(): %v", err) } @@ -75,7 +75,7 @@ func TestHashLogRoot(t *testing.T) { }, }, } { - hash, err := HashLogRoot(test.root) + hash, err := hashLogRoot(test.root) if err != nil { t.Fatalf("HashLogRoot(): %v", err) } diff --git a/crypto/signer.go b/crypto/signer.go index d617b6cfc0..6400b2ea03 100644 --- a/crypto/signer.go +++ b/crypto/signer.go @@ -85,7 +85,7 @@ func (s *Signer) SignObject(obj interface{}) (*sigpb.DigitallySigned, error) { // SignLogRoot hashes and signs the supplied (to-be) SignedLogRoot and returns a SignedLogRoot func (s *Signer) SignLogRoot(root *trillian.SignedLogRoot) (*trillian.SignedLogRoot, error) { - hash, err := HashLogRoot(*root) + hash, err := hashLogRoot(*root) if err != nil { return nil, err } diff --git a/crypto/signer_test.go b/crypto/signer_test.go index 8580db4ab0..ab765deb55 100644 --- a/crypto/signer_test.go +++ b/crypto/signer_test.go @@ -90,7 +90,7 @@ func TestSignWithSignedLogRoot_SignerFails(t *testing.T) { s := testonly.NewSignerWithErr(key, errors.New("signfail")) root := trillian.SignedLogRoot{TimestampNanos: 2267709, RootHash: []byte("Islington"), TreeSize: 2} - hash, err := HashLogRoot(root) + hash, err := hashLogRoot(root) if err != nil { t.Fatalf("HashLogRoot(): %v", err) } diff --git a/crypto/verifier.go b/crypto/verifier.go index 2029cb8f16..5e173aa344 100644 --- a/crypto/verifier.go +++ b/crypto/verifier.go @@ -40,7 +40,7 @@ var ( // VerifySignedLogRoot verifies the SignedLogRoot and returns its contents. func VerifySignedLogRoot(pub crypto.PublicKey, r *trillian.SignedLogRoot) (*trillian.SignedLogRoot, error) { // Verify SignedLogRoot signature. - hash, err := HashLogRoot(*r) + hash, err := hashLogRoot(*r) if err != nil { return nil, err }