mkem

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package mkem provides multiparty KEM construction.

Package mkem provides multiparty KEM construction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ciphertext

type Ciphertext struct {
	EphemeralPublicKey nike.PublicKey
	DEKCiphertexts     [][]byte
	Envelope           []byte
}

func CiphertextFromBytes

func CiphertextFromBytes(scheme *Scheme, b []byte) (*Ciphertext, error)

func (*Ciphertext) Marshal

func (m *Ciphertext) Marshal() []byte

type IntermediaryCiphertext

type IntermediaryCiphertext struct {
	EphemeralPublicKey []byte
	DEKCiphertexts     [][]byte
	Envelope           []byte
}

func (*IntermediaryCiphertext) Bytes

func (i *IntermediaryCiphertext) Bytes() []byte

func (*IntermediaryCiphertext) FromBytes

func (i *IntermediaryCiphertext) FromBytes(b []byte) error

type Scheme

type Scheme struct {
	// contains filtered or unexported fields
}

Scheme is an MKEM scheme.

func NewScheme

func NewScheme(scheme nike.Scheme) *Scheme

func (*Scheme) Decapsulate

func (s *Scheme) Decapsulate(privkey nike.PrivateKey, ciphertext []byte) ([]byte, error)

func (*Scheme) DecryptEnvelope

func (s *Scheme) DecryptEnvelope(privkey nike.PrivateKey, pubkey nike.PublicKey, ciphertext []byte) ([]byte, error)

func (*Scheme) Encapsulate

func (s *Scheme) Encapsulate(keys []nike.PublicKey, payload []byte) (nike.PrivateKey, []byte)

func (*Scheme) EnvelopeReply

func (s *Scheme) EnvelopeReply(privkey nike.PrivateKey, pubkey nike.PublicKey, plaintext []byte) []byte

func (*Scheme) GenerateKeyPair

func (s *Scheme) GenerateKeyPair() (nike.PublicKey, nike.PrivateKey, error)

Jump to

Keyboard shortcuts

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