aead

package
v0.0.0-...-cb92b4e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

package aead provides an interface for Advanced Encryption with Associated Data (AEAD).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendOpenK256N64

func AppendOpenK256N64(out []byte, sch K256N64, key *[32]byte, nonce [8]byte, ctext, ad []byte) ([]byte, error)

AppendSealK256N64 appends to out

func AppendOpenSUV256

func AppendOpenSUV256(sch SUV256, out []byte, suv *[32]byte, ctext, ad []byte) ([]byte, error)

func AppendSealK256N64

func AppendSealK256N64(out []byte, sch K256N64, key *[32]byte, nonce [8]byte, ptext, ad []byte) []byte

AppendSealK256N64 appends is like to out.

func AppendSealSUV256

func AppendSealSUV256(sch SUV256, out []byte, suv *[32]byte, ptext, ad []byte) []byte

func TestK256N192

func TestK256N192(t *testing.T, s K256N192)

func TestK256N64

func TestK256N64(t *testing.T, s K256N64)

func TestSUV256

func TestSUV256(t *testing.T, s SUV256)

Types

type K256N192

type K256N192 interface {
	// Seal creates an confidential and authenticated ciphertext for ptext and writes it to dst
	SealK256N192(dst []byte, key *[32]byte, nonce *[24]byte, ptext, ad []byte)
	// Open authenticates and decryptes ctext and writes the result to dst or returns an error.
	OpenK256N192(dst []byte, key *[32]byte, nonce *[24]byte, ctext, ad []byte) error
	// Overhead is the ciphertext_size - plaintext_size
	Overhead() int
}

K256N192 is an AEAD with a 256 bit key and a 192 bit nonce 192 bits is large enough to use randomly generated nonces.

type K256N64

type K256N64 interface {
	// Seal creates an confidential and authenticated ciphertext for ptext and writes it to dst
	SealK256N64(dst []byte, key *[32]byte, nonce [8]byte, ptext, ad []byte)
	// Open authenticates and decryptes ctext and writes the result to dst or returns an error.
	OpenK256N64(dst []byte, key *[32]byte, nonce [8]byte, ctext, ad []byte) error
	// Overhead is the ciphertext_size - plaintext_size
	Overhead() int
}

K256N64 is an AEAD with a 256 bit key and a 64 bit nonce A 64 bit nonce is not large enough to use randomly generated nonces.

type SUV256

type SUV256 interface {
	// Seal creates an confidential and authenticated ciphertext for ptext and writes it to dst.
	SealSUV256(dst []byte, suv *[32]byte, ptext, ad []byte)
	// Open authenticates and decryptes ctext and writes the result to dst returns an error.
	OpenSUV256(dst []byte, suv *[32]byte, ctext, ad []byte) error
	// Overhead is the ciphertext_size - plaintext_size
	Overhead() int
}

SUV256 is an AEAD which takes a Secret and Unique Value instead of a key and a nonce

Directories

Path Synopsis
package aead_xof implements an AEAD (aead.Scheme256) in terms of an XOF (xof.Scheme)
package aead_xof implements an AEAD (aead.Scheme256) in terms of an XOF (xof.Scheme)

Jump to

Keyboard shortcuts

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