diff options
author | Linus Nordberg <linus@nordberg.se> | 2022-04-29 15:21:33 +0200 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@mullvad.net> | 2022-04-29 22:07:01 +0200 |
commit | 60131023dd5b3d28175d4cc5f7519086793482dd (patch) | |
tree | 5685b8b8c3342fb24e1ae8c033267a2c27ba6ce4 | |
parent | 8db1fdd6b372dab210a77f3c0d48d9deebfe5da3 (diff) |
change 'preimage' to 'message'
Issue: #40
-rw-r--r-- | cmd/sigsum-debug/leaf/hash/hash.go | 4 | ||||
-rw-r--r-- | cmd/sigsum-debug/leaf/sign/sign.go | 4 | ||||
-rw-r--r-- | pkg/requests/requests.go | 2 | ||||
-rw-r--r-- | pkg/requests/requests_test.go | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/cmd/sigsum-debug/leaf/hash/hash.go b/cmd/sigsum-debug/leaf/hash/hash.go index 9bc845e..81531b5 100644 --- a/cmd/sigsum-debug/leaf/hash/hash.go +++ b/cmd/sigsum-debug/leaf/hash/hash.go @@ -26,11 +26,11 @@ func Main(args []string, optKeyHash, optSignature string, optShardHint uint64) e return fmt.Errorf("parse signature: %w", err) } - preimage := types.HashFn(data) + message := types.HashFn(data) leaf := types.Leaf{ Statement: types.Statement{ ShardHint: optShardHint, - Checksum: *types.HashFn(preimage[:]), + Checksum: *types.HashFn(message[:]), }, Signature: sig, KeyHash: keyHash, diff --git a/cmd/sigsum-debug/leaf/sign/sign.go b/cmd/sigsum-debug/leaf/sign/sign.go index 348ae23..3b40c32 100644 --- a/cmd/sigsum-debug/leaf/sign/sign.go +++ b/cmd/sigsum-debug/leaf/sign/sign.go @@ -22,10 +22,10 @@ func Main(args []string, optPrivateKey string, optShardHint uint64) error { return fmt.Errorf("parse private key: %w", err) } - preimage := types.HashFn(data) + message := types.HashFn(data) stm := types.Statement{ ShardHint: optShardHint, - Checksum: *types.HashFn(preimage[:]), + Checksum: *types.HashFn(message[:]), } sig, err := stm.Sign(priv) if err != nil { diff --git a/pkg/requests/requests.go b/pkg/requests/requests.go index bb63de0..94b3130 100644 --- a/pkg/requests/requests.go +++ b/pkg/requests/requests.go @@ -13,7 +13,7 @@ import ( type Leaf struct { ShardHint uint64 `ascii:"shard_hint"` - Preimage types.Hash `ascii:"preimage"` + Message types.Hash `ascii:"message"` Signature types.Signature `ascii:"signature"` VerificationKey types.PublicKey `ascii:"verification_key"` DomainHint string `ascii:"domain_hint"` diff --git a/pkg/requests/requests_test.go b/pkg/requests/requests_test.go index c8104ff..d6aaf6c 100644 --- a/pkg/requests/requests_test.go +++ b/pkg/requests/requests_test.go @@ -221,7 +221,7 @@ func validLeaf(t *testing.T) *Leaf { t.Helper() return &Leaf{ ShardHint: 1, - Preimage: *newHashBufferInc(t), + Message: *newHashBufferInc(t), Signature: *newSigBufferInc(t), VerificationKey: *newPubBufferInc(t), DomainHint: "example.com", @@ -232,7 +232,7 @@ func validLeafASCII(t *testing.T) string { t.Helper() return fmt.Sprintf("%s=%d\n%s=%x\n%s=%x\n%s=%x\n%s=%s\n", "shard_hint", 1, - "preimage", newHashBufferInc(t)[:], + "message", newHashBufferInc(t)[:], "signature", newSigBufferInc(t)[:], "verification_key", newPubBufferInc(t)[:], "domain_hint", "example.com", |