onetimeauth

package
v0.0.0-...-cd9060f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package onetimeauth provides primitives for secret-key, single-message authentication.

The onetimeauth function, viewed as a function of the message for a uniform random key, is designed to meet the standard notion of unforgeability after a single message. After the sender authenticates one message, an attacker cannot find authenticators for any other messages.

The sender must not use onetimeauth to authenticate more than one message under the same key. Authenticators for two messages under the same key should be expected to reveal enough information to allow forgeries of authenticators on other messages.

The selected primitive is poly1305, an authenticator specified in "Cryptography in NaCl", Section 9. This authenticator is proven to meet the standard notion of unforgeability after a single message.

This package is interoperable with NaCL: https://nacl.cr.yp.to/onetimeauth.html

Index

Constants

Size is the size, in bytes, of the result of a call to Sum.

Variables

This section is empty.

Functions

func Sum

func Sum(m []byte, key nacl.Key) *[Size]byte

Sum generates an authenticator for m using a one-time key and puts the result (of length Size) into out. Authenticating two different messages with the same key allows an attacker to forge messages at will.

func Verify

func Verify(mac *[Size]byte, m []byte, key nacl.Key) bool

Verify returns true if mac is a valid authenticator for m with the given key, without leaking timing information.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL