kem

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package kem implements the Key Encapsulation Mechanism for kMOSAIC.

Index

Constants

View Source
const (
	DomainSLSS           = "kmosaic-kem-slss-v1"
	DomainTDD            = "kmosaic-kem-tdd-v1"
	DomainEGRW           = "kmosaic-kem-egrw-v1"
	DomainSharedSecret   = "kmosaic-kem-ss-v1"
	DomainEncKey         = "kmosaic-enc-key-v1"
	DomainNonce          = "kmosaic-nonce-v1"
	DomainImplicitReject = "kmosaic-kem-reject-v1"
)

Variables

This section is empty.

Functions

func Decapsulate

Decapsulate recovers the shared secret from a ciphertext.

func Decrypt

Decrypt decrypts an encrypted message.

func Encapsulate

Encapsulate generates a shared secret and ciphertext.

func EncapsulateDeterministic

func EncapsulateDeterministic(pk *kmosaic.MOSAICPublicKey, ephemeralSecret []byte) (*kmosaic.EncapsulationResult, error)

EncapsulateDeterministic performs deterministic encapsulation.

func Encrypt

func Encrypt(pk *kmosaic.MOSAICPublicKey, plaintext []byte) (*kmosaic.EncryptedMessage, error)

Encrypt encrypts a message using KEM+DEM.

func GenerateKeyPair

func GenerateKeyPair(level kmosaic.SecurityLevel) (*kmosaic.MOSAICKeyPair, error)

GenerateKeyPair generates a kMOSAIC key pair.

func GenerateKeyPairFromSeed

func GenerateKeyPairFromSeed(params kmosaic.MOSAICParams, seed []byte) (*kmosaic.MOSAICKeyPair, error)

GenerateKeyPairFromSeed generates a deterministic key pair from seed.

func SerializeCiphertext

func SerializeCiphertext(ct *kmosaic.MOSAICCiphertext) []byte

SerializeCiphertext serializes a ciphertext.

func SerializePublicKey

func SerializePublicKey(pk *kmosaic.MOSAICPublicKey) []byte

SerializePublicKey serializes a public key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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