ocrkey

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrScalarTooBig = errors.Errorf("can't handle scalars greater than %d", curve25519.PointSize)
)

Functions

This section is empty.

Types

type ConfigPublicKey

type ConfigPublicKey [curve25519.PointSize]byte

ConfigPublicKey represents the public key for the config decryption keypair

func (ConfigPublicKey) MarshalJSON

func (cpk ConfigPublicKey) MarshalJSON() ([]byte, error)

func (ConfigPublicKey) Raw

func (cpk ConfigPublicKey) Raw() string

func (*ConfigPublicKey) Scan

func (cpk *ConfigPublicKey) Scan(value any) error

Scan reads the database value and returns an instance.

func (ConfigPublicKey) String

func (cpk ConfigPublicKey) String() string

func (*ConfigPublicKey) UnmarshalJSON

func (cpk *ConfigPublicKey) UnmarshalJSON(input []byte) error

func (*ConfigPublicKey) UnmarshalText

func (cpk *ConfigPublicKey) UnmarshalText(bs []byte) error

func (ConfigPublicKey) Value

func (cpk ConfigPublicKey) Value() (driver.Value, error)

Value returns this instance serialized for database storage.

type EncryptedOCRKeyExport

type EncryptedOCRKeyExport struct {
	KeyType               string                `json:"keyType"`
	ID                    string                `json:"id"`
	OnChainSigningAddress OnChainSigningAddress `json:"onChainSigningAddress"`
	OffChainPublicKey     OffChainPublicKey     `json:"offChainPublicKey"`
	ConfigPublicKey       ConfigPublicKey       `json:"configPublicKey"`
	Crypto                keystore.CryptoJSON   `json:"crypto"`
}

func (EncryptedOCRKeyExport) GetCrypto

type KeyV2

type KeyV2 struct {
	OnChainSigning     *onChainPrivateKey
	OffChainSigning    *offChainPrivateKey
	OffChainEncryption *[curve25519.ScalarSize]byte
	// contains filtered or unexported fields
}

func FromEncryptedJSON

func FromEncryptedJSON(keyJSON []byte, password string) (KeyV2, error)

func KeyFor

func KeyFor(raw internal.Raw) KeyV2

func MustNewV2XXXTestingOnly

func MustNewV2XXXTestingOnly(k *big.Int) KeyV2

func NewV2

func NewV2() (KeyV2, error)

func (KeyV2) ConfigDiffieHellman

func (key KeyV2) ConfigDiffieHellman(base *[curve25519.PointSize]byte) (
	sharedPoint *[curve25519.PointSize]byte, err error,
)

ConfigDiffieHellman returns the shared point obtained by multiplying someone's public key by a secret scalar ( in this case, the OffChainEncryption key.)

func (KeyV2) GetID

func (key KeyV2) GetID() string

func (KeyV2) ID

func (key KeyV2) ID() string

func (KeyV2) MarshalJSON

func (key KeyV2) MarshalJSON() ([]byte, error)

MarshalJSON marshals the private keys into json

func (KeyV2) PublicKeyAddressOnChain

func (key KeyV2) PublicKeyAddressOnChain() ocrtypes.OnChainSigningAddress

PublicKeyAddressOnChain returns public component of the keypair used in SignOnChain

func (KeyV2) PublicKeyConfig

func (key KeyV2) PublicKeyConfig() [curve25519.PointSize]byte

PublicKeyConfig returns the public component of the keypair used in ConfigKeyShare

func (KeyV2) PublicKeyOffChain

func (key KeyV2) PublicKeyOffChain() ocrtypes.OffchainPublicKey

PublicKeyOffChain returns the public component of the keypair used in SignOffChain

func (KeyV2) Raw

func (key KeyV2) Raw() internal.Raw

func (KeyV2) SignOffChain

func (key KeyV2) SignOffChain(msg []byte) (signature []byte, err error)

SignOffChain returns an EdDSA-Ed25519 signature on msg.

func (KeyV2) SignOnChain

func (key KeyV2) SignOnChain(msg []byte) (signature []byte, err error)

SignOnChain returns an ethereum-style ECDSA secp256k1 signature on msg.

func (KeyV2) ToEncryptedJSON

func (key KeyV2) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error)

func (*KeyV2) UnmarshalJSON

func (key *KeyV2) UnmarshalJSON(b []byte) (err error)

type OffChainPublicKey

type OffChainPublicKey ed25519.PublicKey

func (OffChainPublicKey) MarshalJSON

func (ocpk OffChainPublicKey) MarshalJSON() ([]byte, error)

func (OffChainPublicKey) Raw

func (ocpk OffChainPublicKey) Raw() string

func (*OffChainPublicKey) Scan

func (ocpk *OffChainPublicKey) Scan(value any) error

func (OffChainPublicKey) String

func (ocpk OffChainPublicKey) String() string

func (*OffChainPublicKey) UnmarshalJSON

func (ocpk *OffChainPublicKey) UnmarshalJSON(input []byte) error

func (*OffChainPublicKey) UnmarshalText

func (ocpk *OffChainPublicKey) UnmarshalText(bs []byte) error

func (OffChainPublicKey) Value

func (ocpk OffChainPublicKey) Value() (driver.Value, error)

type OnChainPublicKey

type OnChainPublicKey ecdsa.PublicKey

func (OnChainPublicKey) Address

type OnChainSigningAddress

type OnChainSigningAddress ocrtypes.OnChainSigningAddress

func (OnChainSigningAddress) MarshalJSON

func (ocsa OnChainSigningAddress) MarshalJSON() ([]byte, error)

func (*OnChainSigningAddress) Scan

func (ocsa *OnChainSigningAddress) Scan(value any) error

func (OnChainSigningAddress) String

func (ocsa OnChainSigningAddress) String() string

func (*OnChainSigningAddress) UnmarshalJSON

func (ocsa *OnChainSigningAddress) UnmarshalJSON(input []byte) error

func (*OnChainSigningAddress) UnmarshalText

func (ocsa *OnChainSigningAddress) UnmarshalText(bs []byte) error

func (OnChainSigningAddress) Value

func (ocsa OnChainSigningAddress) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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