crypto

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListSigners

func ListSigners() []string

ListSigners returns the names of all registered signers

func RegisterSigner

func RegisterSigner(name string, s Signer)

RegisterSigner registers a new signer implementation by name

func SetActiveSigner

func SetActiveSigner(name string) bool

SetActiveSigner sets the active signer by name

Types

type ECDSASigner

type ECDSASigner struct{}

func NewECDSASigner

func NewECDSASigner() *ECDSASigner

func (*ECDSASigner) GenerateKey

func (e *ECDSASigner) GenerateKey() ([]byte, []byte)

func (*ECDSASigner) Name

func (e *ECDSASigner) Name() string

func (*ECDSASigner) Sign

func (e *ECDSASigner) Sign(privateKey []byte, message []byte) []byte

func (*ECDSASigner) Verify

func (e *ECDSASigner) Verify(publicKey []byte, message []byte, signature []byte) bool

type KeyPair

type KeyPair struct {
	PublicKey string
	SecretKey string
}

KeyPair holds a Dilithium public and private key in hex encoding.

func GenerateDilithium2KeyPair

func GenerateDilithium2KeyPair() (*KeyPair, error)

GenerateDilithium2KeyPair generates a quantum-resistant Dilithium2 key pair.

type Signer

type Signer interface {
	GenerateKey() ([]byte, []byte) // private, public
	Sign(privateKey []byte, message []byte) []byte
	Verify(publicKey []byte, message []byte, signature []byte) bool
	Name() string
}

Signer defines the interface for cryptographic signing algorithms Features (e.g., quantum_signing) should implement this interface and register their signer at runtime.

func GetSigner

func GetSigner() Signer

GetSigner returns the currently active signer

Jump to

Keyboard shortcuts

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