dilithium

package
v2.3.6 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

nolint

nolint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(keyType bccrypto.KeyType) (bccrypto.PrivateKey, error)

func ParsePrivateKey

func ParsePrivateKey(der []byte) (bccrypto.PrivateKey, error)

ParsePrivateKey is used to parse pqc private key

func ParsePubKey

func ParsePubKey(der []byte) (bccrypto.PublicKey, error)

ParsePubKey is used parse pqc public key

Types

type PrivateKey

type PrivateKey struct {
	SK  []byte //PackSK
	PK  []byte //PackPk
	Dlt *dilithium.Dilithium
}

func (*PrivateKey) Bytes

func (key *PrivateKey) Bytes() ([]byte, error)

func (*PrivateKey) PublicKey

func (key *PrivateKey) PublicKey() bccrypto.PublicKey

func (*PrivateKey) Sign

func (key *PrivateKey) Sign(data []byte) ([]byte, error)

func (*PrivateKey) SignWithOpts

func (key *PrivateKey) SignWithOpts(data []byte, opts *bccrypto.SignOpts) ([]byte, error)

func (*PrivateKey) String

func (key *PrivateKey) String() (string, error)

func (*PrivateKey) ToStandardKey

func (key *PrivateKey) ToStandardKey() crypto.PrivateKey

func (*PrivateKey) Type

func (key *PrivateKey) Type() bccrypto.KeyType

type PublicKey

type PublicKey struct {
	K   []byte //PackPK
	Dlt *dilithium.Dilithium
}

PublicKey is pqc public key

func (*PublicKey) Bytes

func (p *PublicKey) Bytes() ([]byte, error)

func (*PublicKey) String

func (p *PublicKey) String() (string, error)

func (*PublicKey) ToStandardKey

func (p *PublicKey) ToStandardKey() crypto.PublicKey

func (*PublicKey) Type

func (p *PublicKey) Type() bccrypto.KeyType

func (*PublicKey) Verify

func (p *PublicKey) Verify(data []byte, sig []byte) (bool, error)

func (*PublicKey) VerifyWithOpts

func (p *PublicKey) VerifyWithOpts(data []byte, sig []byte, opts *bccrypto.SignOpts) (bool, error)

Jump to

Keyboard shortcuts

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