Documentation
¶
Index ¶
Constants ¶
const TagSize = 16
TagSize is the size, in bytes, of a Poly1305 authenticator.
Variables ¶
This section is empty.
Functions ¶
func Sum ¶
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.
Types ¶
type MAC ¶
type MAC struct {
// contains filtered or unexported fields
}
MAC is an io.Writer computing an authentication tag of the data written to it.
MAC cannot be used like common hash.Hash implementations, because using a Poly1305 key twice breaks its security. Therefore writing data to a running MAC after calling Sum or Verify causes it to panic.
func New ¶
New returns a new MAC computing an authentication tag of all data written to it with the given key.
func (*MAC) Sum ¶
Sum computes the authenticator of all data written to the message authentication code.