Documentation ¶
Overview ¶
Package poly1305 implements Poly1305 one-time message authentication code defined in RFC 7539..
Poly1305 is a fast, one-time authentication function. It is infeasible for an attacker to generate an authenticator for a message without the key. However, a key must only be used for a single message. Authenticating two different messages with the same key allows an attacker to forge authenticators for other messages with the same key.
Index ¶
Constants ¶
const TagSize = 16
TagSize is the size of the poly1305 authentication tag in bytes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
Hash implements the poly1305 authenticator. Poly1305 cannot be used like common hash.Hash implementations, because using a poly1305 key twice breaks its security.
func New ¶
New returns a Hash computing the poly1305 sum. Notice that Poly1305 is insecure if one key is used twice.