asymmetric

package
v1.7.10 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 13 Imported by: 5

Documentation

Overview

Package asymmetric is a wrapper on Go circl packages - mlkem768, mldsa65.

The package also adds an additional interface for working with a list of public keys.

Index

Constants

View Source
const (
	CDSAPrivKeySize = mldsa.PrivateKeySize
	CDSAPubKeySize  = mldsa.PublicKeySize
	CDSAKeySeedSize = mldsa.SeedSize
	CDSASignSize    = mldsa.SignatureSize
)
View Source
const (
	CKEMPrivKeySize    = mlkem.PrivateKeySize
	CKEMPubKeySize     = mlkem.PublicKeySize
	CKEMKeySeedSize    = mlkem.KeySeedSize
	CKEMCiphertextSize = mlkem.CiphertextSize
)
View Source
const (
	CKeySeedSize = CKEMKeySeedSize + CDSAKeySeedSize
	CPrivKeySize = CKEMPrivKeySize + CDSAPrivKeySize
	CPubKeySize  = CKEMPubKeySize + CDSAPubKeySize
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IDSAPrivKey added in v1.7.0

type IDSAPrivKey interface {
	ToBytes() []byte
	GetPubKey() IDSAPubKey

	SignBytes([]byte) []byte
}

func LoadDSAPrivKey added in v1.7.0

func LoadDSAPrivKey(pBytes []byte) IDSAPrivKey

func NewDSAPrivKey added in v1.7.0

func NewDSAPrivKey() IDSAPrivKey

func NewDSAPrivKeyFromSeed added in v1.7.1

func NewDSAPrivKeyFromSeed(pSeed []byte) IDSAPrivKey

type IDSAPubKey added in v1.7.0

type IDSAPubKey interface {
	ToBytes() []byte

	VerifyBytes([]byte, []byte) bool
}

func LoadDSAPubKey added in v1.7.0

func LoadDSAPubKey(pBytes []byte) IDSAPubKey

type IKEMPrivKey added in v1.7.0

type IKEMPrivKey interface {
	ToBytes() []byte
	GetPubKey() IKEMPubKey

	Decapsulate([]byte) ([]byte, error)
}

func LoadKEMPrivKey added in v1.7.0

func LoadKEMPrivKey(pBytes []byte) IKEMPrivKey

func NewKEMPrivKey added in v1.7.0

func NewKEMPrivKey() IKEMPrivKey

func NewKEMPrivKeyFromSeed added in v1.7.1

func NewKEMPrivKeyFromSeed(pSeed []byte) IKEMPrivKey

type IKEMPubKey added in v1.7.0

type IKEMPubKey interface {
	ToBytes() []byte

	Encapsulate() ([]byte, []byte, error)
}

func LoadKEMPubKey added in v1.7.0

func LoadKEMPubKey(pBytes []byte) IKEMPubKey

type IMapPubKeys added in v1.7.0

type IMapPubKeys interface {
	GetPubKey(IPubKeyHash) IPubKey
	DelPubKey(IPubKey)
	SetPubKey(IPubKey)
}

func NewMapPubKeys added in v1.7.0

func NewMapPubKeys(pPubKeys ...IPubKey) IMapPubKeys

type IPrivKey

type IPrivKey interface {
	types.IConverter

	GetPubKey() IPubKey
	GetKEMPrivKey() IKEMPrivKey
	GetDSAPrivKey() IDSAPrivKey
}

func LoadPrivKey added in v1.7.0

func LoadPrivKey(pKeychain interface{}) IPrivKey

func NewPrivKey added in v1.7.0

func NewPrivKey() IPrivKey

func NewPrivKeyFromSeed added in v1.7.1

func NewPrivKeyFromSeed(pSeed []byte) IPrivKey

type IPubKey

type IPubKey interface {
	types.IConverter
	GetHasher() hashing.IHasher

	GetKEMPubKey() IKEMPubKey
	GetDSAPubKey() IDSAPubKey
}

func LoadPubKey added in v1.7.0

func LoadPubKey(pKeychain interface{}) IPubKey

func NewPubKey added in v1.7.0

func NewPubKey(pKEM IKEMPubKey, pSigner IDSAPubKey) IPubKey

type IPubKeyHash added in v1.7.10

type IPubKeyHash = []byte

Jump to

Keyboard shortcuts

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