Documentation ¶
Index ¶
- Variables
- type ConfigPublicKey
- func (cpk ConfigPublicKey) MarshalJSON() ([]byte, error)
- func (cpk ConfigPublicKey) Raw() string
- func (cpk *ConfigPublicKey) Scan(value interface{}) error
- func (cpk ConfigPublicKey) String() string
- func (cpk *ConfigPublicKey) UnmarshalJSON(input []byte) error
- func (cpk *ConfigPublicKey) UnmarshalText(bs []byte) error
- func (cpk ConfigPublicKey) Value() (driver.Value, error)
- type EncryptedKeyBundle
- type EncryptedOCRKeyExport
- type KeyBundle
- func (pk *KeyBundle) ConfigDiffieHellman(base *[curve25519.PointSize]byte) (sharedPoint *[curve25519.PointSize]byte, err error)
- func (pk *KeyBundle) Encrypt(auth string, scryptParams utils.ScryptParams) (*EncryptedKeyBundle, error)
- func (pk KeyBundle) GoString() string
- func (pk *KeyBundle) MarshalJSON() ([]byte, error)
- func (pk *KeyBundle) PublicKeyAddressOnChain() ocrtypes.OnChainSigningAddress
- func (pk *KeyBundle) PublicKeyConfig() [curve25519.PointSize]byte
- func (pk *KeyBundle) PublicKeyOffChain() ocrtypes.OffchainPublicKey
- func (pk *KeyBundle) SignOffChain(msg []byte) (signature []byte, err error)
- func (pk *KeyBundle) SignOnChain(msg []byte) (signature []byte, err error)
- func (pk KeyBundle) String() string
- func (pk KeyBundle) ToV2() KeyV2
- func (pk *KeyBundle) UnmarshalJSON(b []byte) (err error)
- type KeyV2
- func (key KeyV2) ConfigDiffieHellman(base *[curve25519.PointSize]byte) (sharedPoint *[curve25519.PointSize]byte, err error)
- func (key KeyV2) GetID() string
- func (key KeyV2) GoString() string
- func (key KeyV2) ID() string
- func (key KeyV2) MarshalJSON() ([]byte, error)
- func (key KeyV2) PublicKeyAddressOnChain() ocrtypes.OnChainSigningAddress
- func (key KeyV2) PublicKeyConfig() [curve25519.PointSize]byte
- func (key KeyV2) PublicKeyOffChain() ocrtypes.OffchainPublicKey
- func (key KeyV2) Raw() Raw
- func (key KeyV2) SignOffChain(msg []byte) (signature []byte, err error)
- func (key KeyV2) SignOnChain(msg []byte) (signature []byte, err error)
- func (key KeyV2) String() string
- func (key KeyV2) ToEncryptedJSON(password string, scryptParams utils.ScryptParams) (export []byte, err error)
- func (key *KeyV2) UnmarshalJSON(b []byte) (err error)
- type OffChainPublicKey
- func (ocpk OffChainPublicKey) MarshalJSON() ([]byte, error)
- func (ocpk OffChainPublicKey) Raw() string
- func (ocpk *OffChainPublicKey) Scan(value interface{}) error
- func (ocpk OffChainPublicKey) String() string
- func (ocpk *OffChainPublicKey) UnmarshalJSON(input []byte) error
- func (ocpk *OffChainPublicKey) UnmarshalText(bs []byte) error
- func (ocpk OffChainPublicKey) Value() (driver.Value, error)
- type OnChainPublicKey
- type OnChainSigningAddress
- func (ocsa OnChainSigningAddress) MarshalJSON() ([]byte, error)
- func (ocsa *OnChainSigningAddress) Scan(value interface{}) error
- func (ocsa OnChainSigningAddress) String() string
- func (ocsa *OnChainSigningAddress) UnmarshalJSON(input []byte) error
- func (ocsa *OnChainSigningAddress) UnmarshalText(bs []byte) error
- func (ocsa OnChainSigningAddress) Value() (driver.Value, error)
- type Raw
Constants ¶
This section is empty.
Variables ¶
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 interface{}) 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
type EncryptedKeyBundle ¶
type EncryptedKeyBundle struct { ID models.Sha256Hash OnChainSigningAddress OnChainSigningAddress OffChainPublicKey OffChainPublicKey ConfigPublicKey ConfigPublicKey EncryptedPrivateKeys []byte CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time }
EncryptedKeyBundle holds an encrypted KeyBundle
func (*EncryptedKeyBundle) Decrypt ¶
func (ekb *EncryptedKeyBundle) Decrypt(auth string) (*KeyBundle, error)
Decrypt returns the PrivateKeys in e, decrypted via auth, or an error
func (EncryptedKeyBundle) GetID ¶
func (ekb EncryptedKeyBundle) GetID() string
func (*EncryptedKeyBundle) SetID ¶
func (ekb *EncryptedKeyBundle) SetID(value string) error
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"` }
type KeyBundle ¶
type KeyBundle struct { ID models.Sha256Hash // contains filtered or unexported fields }
KeyBundle represents the bundle of keys needed for OCR
func New ¶ added in v1.2.0
New makes a new set of OCR key bundles from cryptographically secure entropy
func NewFrom ¶ added in v1.2.0
func NewFrom(onChainSigning io.Reader, offChainSigning io.Reader, offChainEncryption io.Reader) (*KeyBundle, error)
NewFrom makes a new set of OCR key bundles from cryptographically secure entropy
func (*KeyBundle) ConfigDiffieHellman ¶
func (pk *KeyBundle) 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 (*KeyBundle) Encrypt ¶
func (pk *KeyBundle) Encrypt(auth string, scryptParams utils.ScryptParams) (*EncryptedKeyBundle, error)
Encrypt combines the KeyBundle into a single json-serialized bytes array and then encrypts
func (KeyBundle) GoString ¶ added in v1.0.0
GoString reduces the risk of accidentally logging the private key
func (*KeyBundle) MarshalJSON ¶
MarshalJSON marshals the private keys into json
func (*KeyBundle) PublicKeyAddressOnChain ¶
func (pk *KeyBundle) PublicKeyAddressOnChain() ocrtypes.OnChainSigningAddress
PublicKeyAddressOnChain returns public component of the keypair used in SignOnChain
func (*KeyBundle) PublicKeyConfig ¶
func (pk *KeyBundle) PublicKeyConfig() [curve25519.PointSize]byte
PublicKeyConfig returns the public component of the keypair used in ConfigKeyShare
func (*KeyBundle) PublicKeyOffChain ¶
func (pk *KeyBundle) PublicKeyOffChain() ocrtypes.OffchainPublicKey
PublicKeyOffChain returns the public component of the keypair used in SignOffChain
func (*KeyBundle) SignOffChain ¶
SignOffChain returns an EdDSA-Ed25519 signature on msg.
func (*KeyBundle) SignOnChain ¶
SignOnChain returns an ethereum-style ECDSA secp256k1 signature on msg.
func (KeyBundle) ToV2 ¶ added in v1.0.0
GoString reduces the risk of accidentally logging the private key
func (*KeyBundle) UnmarshalJSON ¶
UnmarshalJSON constructs KeyBundle from raw json
type KeyV2 ¶ added in v1.0.0
type KeyV2 struct { OnChainSigning *onChainPrivateKey OffChainSigning *offChainPrivateKey OffChainEncryption *[curve25519.ScalarSize]byte }
func FromEncryptedJSON ¶ added in v1.0.0
func MustNewV2XXXTestingOnly ¶ added in v1.0.0
func (KeyV2) ConfigDiffieHellman ¶ added in v1.0.0
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) MarshalJSON ¶ added in v1.0.0
MarshalJSON marshals the private keys into json
func (KeyV2) PublicKeyAddressOnChain ¶ added in v1.0.0
func (key KeyV2) PublicKeyAddressOnChain() ocrtypes.OnChainSigningAddress
PublicKeyAddressOnChain returns public component of the keypair used in SignOnChain
func (KeyV2) PublicKeyConfig ¶ added in v1.0.0
func (key KeyV2) PublicKeyConfig() [curve25519.PointSize]byte
PublicKeyConfig returns the public component of the keypair used in ConfigKeyShare
func (KeyV2) PublicKeyOffChain ¶ added in v1.0.0
func (key KeyV2) PublicKeyOffChain() ocrtypes.OffchainPublicKey
PublicKeyOffChain returns the public component of the keypair used in SignOffChain
func (KeyV2) SignOffChain ¶ added in v1.0.0
SignOffChain returns an EdDSA-Ed25519 signature on msg.
func (KeyV2) SignOnChain ¶ added in v1.0.0
SignOnChain returns an ethereum-style ECDSA secp256k1 signature on msg.
func (KeyV2) ToEncryptedJSON ¶ added in v1.0.0
func (*KeyV2) UnmarshalJSON ¶ added in v1.0.0
type OffChainPublicKey ¶
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 interface{}) 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
type OnChainPublicKey ¶
func (OnChainPublicKey) Address ¶
func (k OnChainPublicKey) Address() OnChainSigningAddress
type OnChainSigningAddress ¶
type OnChainSigningAddress ocrtypes.OnChainSigningAddress
func (OnChainSigningAddress) MarshalJSON ¶
func (ocsa OnChainSigningAddress) MarshalJSON() ([]byte, error)
func (*OnChainSigningAddress) Scan ¶
func (ocsa *OnChainSigningAddress) Scan(value interface{}) 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