aont

package
v0.0.0-...-d646b5f Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

All-Or-Nothing-Transform, based on OAEP.

This package implements OAEP (Optimal Asymmetric Encryption Padding) (http://cseweb.ucsd.edu/~mihir/papers/oaep.html) used there as All-Or-Nothing-Transformation (http://theory.lcs.mit.edu/~cis/pubs/rivest/fusion.ps). We do not fix OAEP parts length, instead we add hash-based checksum like in SAEP+ (http://crypto.stanford.edu/~dabo/abstracts/saep.html).

AONT takes 128-bit random r, data M to be encoded and produce the package PKG:

PKG = P1 || P2
 P1 = ChaCha20(key=r, nonce=0x00, 0x00) XOR (M || BLAKE2b(r || M))
 P2 = BLAKE2b(P1) XOR r

Index

Constants

View Source
const (
	HSize = 32
	RSize = 16
)

Variables

This section is empty.

Functions

func Decode

func Decode(in []byte) ([]byte, error)

Decode the data from AONT package. Data size will be smaller than the original one for 48 bytes.

func Encode

func Encode(r *[RSize]byte, in []byte) ([]byte, error)

Encode the data, produce AONT package. Data size will be larger than the original one for 48 bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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