acorn

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: ISC Imports: 5 Imported by: 0

README

go-acorn

GoDoc

Documentation

Overview

Package acorn implements the ACORN-128 authenticated encryption algorithm designed by Hongjun Wu, as specified in

https://competitions.cr.yp.to/round3/acornv3.pdf

ACORN was one of the six winners of the CAESAR competition: It is the second choice for use case 1 (lightwight applications in resource-constrained evironments). If you are not operating in a resource-constrained environment, AES-GCM is probably a better choice.

ACORN is claimed to be secure provided that the following conditions are met:

  1. The key should be generated in a secure and random way

  2. A key, nonce pair should not be used to protect more than one message

  3. If verification fails, the decrypted plaintext and wrong authentication tag should not be given as output

Please note that repeating a nonce may allow an attacker to trivially forge arbitrary messages. Nonces should either be chosen at random (such as with RandomNonce) or assigned sequentially in a manner guaranteed never to repeat.

Index

Constants

View Source
const (
	KeySize   = 128 / 8
	NonceSize = 128 / 8
	TagSize   = 128 / 8
)

Variables

This section is empty.

Functions

func NewAEAD

func NewAEAD(key []byte) cipher.AEAD

New returns a ACORN instance that uses the given 128-bit key. If the key is not the correct length, NewAEAD will panic.

func RandomKey

func RandomKey() []uint8

RandomKey returns a securely-generated random 16-byte key.

func RandomNonce

func RandomNonce() []uint8

RandomNonce returns a securely-generated random 16-byte nonce suitable for passing to Seal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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