Documentation
¶
Index ¶
- Variables
- type KeyType
- type Keychain
- type PQKeychain
- func (kc *PQKeychain) AddHybrid(classical *secp256k1.PrivateKey, pq interface{}) ids.ShortID
- func (kc *PQKeychain) AddMLDSA(key *mldsa.PrivateKey, keyType KeyType) ids.ShortID
- func (kc *PQKeychain) AddSLHDSA(key *slhdsa.PrivateKey, keyType KeyType) ids.ShortID
- func (kc *PQKeychain) AddSecp256k1(key *secp256k1.PrivateKey) ids.ShortID
- func (kc *PQKeychain) Addresses() []ids.ShortID
- func (kc *PQKeychain) GenerateKey() (ids.ShortID, error)
- func (kc *PQKeychain) Get(addr ids.ShortID) (Signer, bool)
- func (kc *PQKeychain) GetPQSigner(addr ids.ShortID) (*PQSigner, bool)
- func (kc *PQKeychain) SetDefaultType(keyType KeyType)
- type PQSigner
- type Signer
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidKeyType = errors.New("invalid key type") ErrKeyNotFound = errors.New("key not found") )
Functions ¶
This section is empty.
Types ¶
type KeyType ¶ added in v1.16.56
type KeyType uint8
KeyType represents the type of cryptographic key
const ( // Classical cryptography KeyTypeSecp256k1 KeyType = iota KeyTypeBLS // BLS signatures for consensus // Post-quantum cryptography (NIST FIPS standards) KeyTypeMLDSA44 // FIPS 204 - ML-DSA-44 KeyTypeMLDSA65 // FIPS 204 - ML-DSA-65 KeyTypeMLDSA87 // FIPS 204 - ML-DSA-87 KeyTypeSLHDSA128 // FIPS 205 - SLH-DSA-128 KeyTypeSLHDSA192 // FIPS 205 - SLH-DSA-192 KeyTypeSLHDSA256 // FIPS 205 - SLH-DSA-256 // Key encapsulation (FIPS 203) KeyTypeMLKEM512 // ML-KEM-512 KeyTypeMLKEM768 // ML-KEM-768 KeyTypeMLKEM1024 // ML-KEM-1024 // Privacy-preserving KeyTypeRingtail // Ring signatures // Hybrid modes (classical + post-quantum) KeyTypeHybridSecp256k1MLDSA44 KeyTypeHybridSecp256k1SLHDSA128 KeyTypeHybridBLSMLDSA44 )
type Keychain ¶
Keychain interface that wallet signers can use This allows both secp256k1fx.Keychain and ledger-lux-go/keychain.Keychain to be used Generic across chains, DAGs, and post-quantum crypto
type PQKeychain ¶ added in v1.16.56
type PQKeychain struct {
// contains filtered or unexported fields
}
PQKeychain implements Keychain with post-quantum support
func NewPQKeychain ¶ added in v1.16.56
func NewPQKeychain(defaultType KeyType) *PQKeychain
NewPQKeychain creates a new post-quantum keychain
func (*PQKeychain) AddHybrid ¶ added in v1.16.56
func (kc *PQKeychain) AddHybrid(classical *secp256k1.PrivateKey, pq interface{}) ids.ShortID
AddHybrid adds a hybrid classical+PQ key pair
func (*PQKeychain) AddMLDSA ¶ added in v1.16.56
func (kc *PQKeychain) AddMLDSA(key *mldsa.PrivateKey, keyType KeyType) ids.ShortID
AddMLDSA adds an ML-DSA key to the keychain
func (*PQKeychain) AddSLHDSA ¶ added in v1.16.56
func (kc *PQKeychain) AddSLHDSA(key *slhdsa.PrivateKey, keyType KeyType) ids.ShortID
AddSLHDSA adds an SLH-DSA key to the keychain
func (*PQKeychain) AddSecp256k1 ¶ added in v1.16.56
func (kc *PQKeychain) AddSecp256k1(key *secp256k1.PrivateKey) ids.ShortID
AddSecp256k1 adds a secp256k1 key to the keychain
func (*PQKeychain) Addresses ¶ added in v1.16.56
func (kc *PQKeychain) Addresses() []ids.ShortID
Addresses returns all addresses in the keychain
func (*PQKeychain) GenerateKey ¶ added in v1.16.56
func (kc *PQKeychain) GenerateKey() (ids.ShortID, error)
GenerateKey generates a new key of the default type
func (*PQKeychain) Get ¶ added in v1.16.56
func (kc *PQKeychain) Get(addr ids.ShortID) (Signer, bool)
Get returns the signer for the given address
func (*PQKeychain) GetPQSigner ¶ added in v1.16.56
func (kc *PQKeychain) GetPQSigner(addr ids.ShortID) (*PQSigner, bool)
GetPQSigner returns the PQ signer for advanced operations
func (*PQKeychain) SetDefaultType ¶ added in v1.16.56
func (kc *PQKeychain) SetDefaultType(keyType KeyType)
SetDefaultType sets the default key type for new keys
type PQSigner ¶ added in v1.16.56
type PQSigner struct {
// contains filtered or unexported fields
}
PQSigner implements Signer with post-quantum support
func (*PQSigner) Address ¶ added in v1.16.56
Address returns the address associated with this signer