Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeySize = errors.New("invalid key size") ErrSeedSize = errors.New("invalid seed size") ErrCiphertext = errors.New("invalid ciphertext size") ErrEncapsulationSeed = errors.New("invalid encapsulation seed size") )
errors.
Functions ¶
Types ¶
type PrivateKey ¶
type PrivateKey interface { Scheme() Scheme Equal(PrivateKey) bool // Bytes allocates a new slice of bytes with Scheme().PrivateKeySize() length // and writes the private key to it. Bytes() []byte // Decapsulate decapsulates the shared secret from the provided ciphertext. Decapsulate(ciphertext []byte) ([]byte, error) }
PrivateKey represents a KEM private key.
type PublicKey ¶
type PublicKey interface { Scheme() Scheme Equal(PublicKey) bool // Bytes allocates a new slice of bytes with Scheme().PublicKeySize() length // and writes the public key to it. Bytes() []byte // Encapsulate encapsulates a shared secret generated from provided seed. Encapsulate(seed []byte) (ciphertext, secret []byte, err error) }
PublicKey represents a KEM public key.
type Scheme ¶
type Scheme interface { // DeriveKey derives a key-pair from a seed. DeriveKey(seed []byte) (PrivateKey, PublicKey, error) // Unpacks a PublicKey from the provided bytes. UnpackPublic(key []byte) (PublicKey, error) // Unpacks a PrivateKey from the provided bytes. UnpackPrivate(key []byte) (PrivateKey, error) // Size of packed public keys. PublicKeySize() int // Size of packed private keys. PrivateKeySize() int // Size of encapsulated shared secret. CiphertextSize() int SharedSecretSize() int // Size of encapsulation seed. EncapsulationSeedSize() int // Size of seed. SeedSize() int }
Scheme represents a KEM scheme.
func Frodo640Shake ¶ added in v0.2.0
func Frodo640Shake() Scheme
Frodo640Shake returns the variant FrodoKEM-640 with SHAKE.
Click to show internal directories.
Click to hide internal directories.