cipher

package
v3.0.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagSize = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AesContentCipher

type AesContentCipher struct {
	NonceGenerator keygen.Generator
	// contains filtered or unexported fields
}

AesContentCipher represents a cipher based on AES

func (AesContentCipher) Decrypt

func (c AesContentCipher) Decrypt(cek, iv, ciphertxt, tag, aad []byte) (plaintext []byte, err error)

func (AesContentCipher) Encrypt

func (c AesContentCipher) Encrypt(cek, plaintext, aad []byte) (iv, ciphertxt, tag []byte, err error)

func (AesContentCipher) KeySize

func (c AesContentCipher) KeySize() int

func (AesContentCipher) TagSize

func (c AesContentCipher) TagSize() int

type ContentCipher

type ContentCipher interface {
	KeySize() int
	Encrypt(cek, aad, plaintext []byte) ([]byte, []byte, []byte, error)
	Decrypt(cek, iv, aad, ciphertext, tag []byte) ([]byte, error)
}

ContentCipher knows how to encrypt/decrypt the content given a content encryption key and other data

type Fetcher

type Fetcher interface {
	Fetch([]byte) (cipher.AEAD, error)
}

Jump to

Keyboard shortcuts

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