hybrid

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, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUninitialized = errors.New("public or private key not initialized")
)

Functions

This section is empty.

Types

type PrivateKey

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

Private key of a hybrid KEM.

func (*PrivateKey) Equal

func (sk *PrivateKey) Equal(other kem.PrivateKey) bool

func (*PrivateKey) MarshalBinary

func (sk *PrivateKey) MarshalBinary() ([]byte, error)

func (*PrivateKey) Public

func (sk *PrivateKey) Public() kem.PublicKey

func (*PrivateKey) Scheme

func (sk *PrivateKey) Scheme() kem.Scheme

type PublicKey

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

Public key of a hybrid KEM.

func (*PublicKey) Equal

func (pk *PublicKey) Equal(other kem.PublicKey) bool

func (*PublicKey) MarshalBinary

func (pk *PublicKey) MarshalBinary() ([]byte, error)

func (*PublicKey) MarshalText added in v0.0.3

func (sk *PublicKey) MarshalText() (text []byte, err error)

func (*PublicKey) Scheme

func (pk *PublicKey) Scheme() kem.Scheme

type Scheme

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

Scheme for a hybrid KEM.

func New

func New(name string, first kem.Scheme, second kem.Scheme) *Scheme

New creates a new hybrid KEM given the first and second KEMs.

func (*Scheme) CiphertextSize

func (sch *Scheme) CiphertextSize() int

func (*Scheme) Decapsulate

func (sch *Scheme) Decapsulate(sk kem.PrivateKey, ct []byte) ([]byte, error)

func (*Scheme) DeriveKeyPair

func (sch *Scheme) DeriveKeyPair(seed []byte) (kem.PublicKey, kem.PrivateKey)

func (*Scheme) Encapsulate

func (sch *Scheme) Encapsulate(pk kem.PublicKey) (ct, ss []byte, err error)

func (*Scheme) EncapsulateDeterministically

func (sch *Scheme) EncapsulateDeterministically(publicKey kem.PublicKey, seed []byte) (ct, ss []byte, err error)

func (*Scheme) GenerateKeyPair

func (sch *Scheme) GenerateKeyPair() (kem.PublicKey, kem.PrivateKey, error)

func (*Scheme) Name

func (sch *Scheme) Name() string

func (*Scheme) PrivateKeySize

func (sch *Scheme) PrivateKeySize() int

func (*Scheme) PublicKeySize

func (sch *Scheme) PublicKeySize() int

func (*Scheme) SeedSize

func (sch *Scheme) SeedSize() int

func (*Scheme) SharedKeySize

func (sch *Scheme) SharedKeySize() int

func (*Scheme) UnmarshalBinaryPrivateKey

func (sch *Scheme) UnmarshalBinaryPrivateKey(buf []byte) (kem.PrivateKey, error)

func (*Scheme) UnmarshalBinaryPublicKey

func (sch *Scheme) UnmarshalBinaryPublicKey(buf []byte) (kem.PublicKey, error)

func (*Scheme) UnmarshalTextPrivateKey added in v0.0.4

func (a *Scheme) UnmarshalTextPrivateKey(text []byte) (kem.PrivateKey, error)

func (*Scheme) UnmarshalTextPublicKey added in v0.0.4

func (a *Scheme) UnmarshalTextPublicKey(text []byte) (kem.PublicKey, error)

Jump to

Keyboard shortcuts

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