Documentation ¶
Index ¶
- type EncryptedKeyBundle
- type KeyBundle
- func (pk *KeyBundle) ConfigDiffieHelman(base *[curve25519.PointSize]byte) (sharedPoint *[curve25519.PointSize]byte, err error)
- func (pk *KeyBundle) Encrypt(auth string) (*EncryptedKeyBundle, error)
- func (pk KeyBundle) GoStringer() string
- func (pk *KeyBundle) MarshalJSON() ([]byte, error)
- func (pk *KeyBundle) PublicKeyAddressOnChain() OnChainSigningAddress
- func (pk *KeyBundle) PublicKeyConfig() [curve25519.PointSize]byte
- func (pk *KeyBundle) PublicKeyOffChain() 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) UnmarshalJSON(b []byte) (err error)
- type OffChainPublicKey
- type OnChainPublicKey
- type OnChainSigningAddress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptedKeyBundle ¶
type EncryptedKeyBundle struct { ID string `gorm:"primary_key"` OnChainSigningAddress OnChainSigningAddress OffChainPublicKey OffChainPublicKey EncryptedPrivateKeys []byte CreatedAt time.Time UpdatedAt time.Time }
EncryptedKeyBundle holds an encrypted KeyBundle
func (*EncryptedKeyBundle) Decrypt ¶
func (encKey *EncryptedKeyBundle) Decrypt(auth string) (*KeyBundle, error)
Decrypt returns the PrivateKeys in e, decrypted via auth, or an error
func (EncryptedKeyBundle) TableName ¶
func (EncryptedKeyBundle) TableName() string
type KeyBundle ¶
type KeyBundle struct { ID string // contains filtered or unexported fields }
KeyBundle represents the bundle of keys needed for OCR
func NewKeyBundle ¶
NewKeyBundle makes a new set of OCR key bundles from cryptographically secure entropy
func (*KeyBundle) ConfigDiffieHelman ¶
func (pk *KeyBundle) ConfigDiffieHelman(base *[curve25519.PointSize]byte) ( sharedPoint *[curve25519.PointSize]byte, err error, )
ConfigDiffieHelman 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) (*EncryptedKeyBundle, error)
Encrypt combines the KeyBundle into a single json-serialized bytes array and then encrypts
func (KeyBundle) GoStringer ¶
GoStringer 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() 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() OffChainPublicKey
PublicKeyOffChain returns the pbulic 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) UnmarshalJSON ¶
UnmarshalJSON constructs KeyBundle from raw json
type OffChainPublicKey ¶
type OnChainPublicKey ¶
func (OnChainPublicKey) Address ¶
func (k OnChainPublicKey) Address() OnChainSigningAddress
type OnChainSigningAddress ¶
func (*OnChainSigningAddress) Scan ¶
func (address *OnChainSigningAddress) Scan(value interface{}) error