Package auth authenticates a message using a secret key.
The Sum function, viewed as a function of the message for a uniform random key, is designed to meet the standard notion of unforgeability. This means that an attacker cannot find authenticators for any messages not authenticated by the sender, even if the attacker has adaptively influenced the messages authenticated by the sender. For a formal definition see, e.g., Section 2.4 of Bellare, Kilian, and Rogaway, "The security of the cipher block chaining message authentication code," Journal of Computer and System Sciences 61 (2000), 362–399; http://www-cse.ucsd.edu/~mihir/papers/cbc.html.
auth does not make any promises regarding "strong" unforgeability; perhaps one valid authenticator can be converted into another valid authenticator for the same message. NaCl also does not make any promises regarding "truncated unforgeability."
This package is interoperable with NaCl: https://nacl.cr.yp.to/auth.html.
Output: eca5a521f3d77b63f567fb0cb6f5f2d200641bc8dada42f60c5f881260c30317 true false
const ( // Size is the size, in bytes, of an authenticated digest. Size = 32 // KeySize is the size, in bytes, of an authentication key. KeySize = 32 )
Sum generates an authenticator for m using a secret key and returns the 32-byte digest.