Documentation
¶
Overview ¶
Package kem implements the Key Encapsulation Mechanism for kMOSAIC.
Index ¶
- Constants
- func Decapsulate(sk *kmosaic.MOSAICSecretKey, pk *kmosaic.MOSAICPublicKey, ...) ([]byte, error)
- func Decrypt(sk *kmosaic.MOSAICSecretKey, pk *kmosaic.MOSAICPublicKey, ...) ([]byte, error)
- func Encapsulate(pk *kmosaic.MOSAICPublicKey) (*kmosaic.EncapsulationResult, error)
- func EncapsulateDeterministic(pk *kmosaic.MOSAICPublicKey, ephemeralSecret []byte) (*kmosaic.EncapsulationResult, error)
- func Encrypt(pk *kmosaic.MOSAICPublicKey, plaintext []byte) (*kmosaic.EncryptedMessage, error)
- func GenerateKeyPair(level kmosaic.SecurityLevel) (*kmosaic.MOSAICKeyPair, error)
- func GenerateKeyPairFromSeed(params kmosaic.MOSAICParams, seed []byte) (*kmosaic.MOSAICKeyPair, error)
- func SerializeCiphertext(ct *kmosaic.MOSAICCiphertext) []byte
- func SerializePublicKey(pk *kmosaic.MOSAICPublicKey) []byte
Constants ¶
View Source
const ( DomainSLSS = "kmosaic-kem-slss-v1" DomainTDD = "kmosaic-kem-tdd-v1" DomainEGRW = "kmosaic-kem-egrw-v1" DomainEncKey = "kmosaic-enc-key-v1" DomainNonce = "kmosaic-nonce-v1" DomainImplicitReject = "kmosaic-kem-reject-v1" )
Variables ¶
This section is empty.
Functions ¶
func Decapsulate ¶
func Decapsulate(sk *kmosaic.MOSAICSecretKey, pk *kmosaic.MOSAICPublicKey, ct *kmosaic.MOSAICCiphertext) ([]byte, error)
Decapsulate recovers the shared secret from a ciphertext.
func Decrypt ¶
func Decrypt(sk *kmosaic.MOSAICSecretKey, pk *kmosaic.MOSAICPublicKey, em *kmosaic.EncryptedMessage) ([]byte, error)
Decrypt decrypts an encrypted message.
func Encapsulate ¶
func Encapsulate(pk *kmosaic.MOSAICPublicKey) (*kmosaic.EncapsulationResult, error)
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.
Click to show internal directories.
Click to hide internal directories.