diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-13 22:28:41 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-14 09:41:56 +1100 |
commit | 30aed94aa8451911fc1c5ba1e52ff28b180a8d31 (patch) | |
tree | b8d68cfe129a94b42077aa2f912da519bfc95e8c /vendor/golang.org/x/crypto/poly1305/poly1305.go | |
parent | 3b1d705473494cca9894ec051d9d928c0c8926c7 (diff) |
update go gitv0.10.6
Diffstat (limited to 'vendor/golang.org/x/crypto/poly1305/poly1305.go')
-rw-r--r-- | vendor/golang.org/x/crypto/poly1305/poly1305.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/golang.org/x/crypto/poly1305/poly1305.go b/vendor/golang.org/x/crypto/poly1305/poly1305.go index d076a5623..066159b79 100644 --- a/vendor/golang.org/x/crypto/poly1305/poly1305.go +++ b/vendor/golang.org/x/crypto/poly1305/poly1305.go @@ -22,8 +22,14 @@ import "crypto/subtle" // TagSize is the size, in bytes, of a poly1305 authenticator. const TagSize = 16 -// Verify returns true if mac is a valid authenticator for m with the given -// key. +// Sum generates an authenticator for msg using a one-time key and puts the +// 16-byte result into out. Authenticating two different messages with the same +// key allows an attacker to forge messages at will. +func Sum(out *[16]byte, m []byte, key *[32]byte) { + sum(out, m, key) +} + +// Verify returns true if mac is a valid authenticator for m with the given key. func Verify(mac *[16]byte, m []byte, key *[32]byte) bool { var tmp [16]byte Sum(&tmp, m, key) |