aegis128l

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Example
if !common.Available {
	return
}
key := make([]byte, KeySize)
rand.Read(key)
aead, err := New(key, 16)
if err != nil {
	panic(err)
}

nonce := make([]byte, aead.NonceSize())
rand.Read(nonce)

ciphertext := aead.Seal(nil, nonce, []byte("hello, world!"), nil)

plaintext, err := aead.Open(nil, nonce, ciphertext, nil)
if err != nil {
	panic(err)
}

fmt.Println(string(plaintext))
Output:

hello, world!

Index

Examples

Constants

View Source
const (
	KeySize   = 16
	NonceSize = 16
)

Variables

This section is empty.

Functions

func New

func New(key []byte, tagLen int) (cipher.AEAD, error)

New returns a new AEAD that uses the provided key and tag length. The key must be 16 bytes long. The tag length must be 16 or 32.

Types

type Aegis128L

type Aegis128L struct {
	common.Aegis
}

func (*Aegis128L) NonceSize

func (aead *Aegis128L) NonceSize() int

The nonce size, in bytes.

func (*Aegis128L) Open

func (aead *Aegis128L) Open(plaintext, nonce, ciphertext, additionalData []byte) ([]byte, error)

func (*Aegis128L) Seal

func (aead *Aegis128L) Seal(dst, nonce, cleartext, additionalData []byte) []byte

Jump to

Keyboard shortcuts

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