Documentation
¶
Index ¶
Constants ¶
const ( OCR2OffchainConfigVersion = 2 OCR3OffchainConfigVersion = 30 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptedSharedSecret ¶
type EncryptedSharedSecret [SharedSecretSize]byte
type OracleIdentity ¶
type OracleIdentity struct {
OffchainPublicKey types.OffchainPublicKey
OnchainPublicKey types.OnchainPublicKey
PeerID string
TransmitAccount types.Account
}
type SharedSecretEncryptions ¶
type SharedSecretEncryptions struct {
DiffieHellmanPoint [curve25519.PointSize]byte
//
// Since SharedSecretEncryptions are shared through a smart contract, each
// oracle will see the same SharedSecretHash. After decryption, oracles can
// check their sharedSecret against SharedSecretHash to prevent the dealer
// from equivocating
SharedSecretHash common.Hash
// i-th oracle can recover the key as follows:
//
// 1. key := Keccak256(DH(DiffieHellmanPoint, process' secret key))[:16]
// 2. sharedSecret := AES128DecryptBlock(key, Encryptions[i])
//
// See Decrypt for details.
Encryptions []EncryptedSharedSecret
}
SharedSecretEncryptions is the encryptions of SharedConfig.SharedSecret, using each oracle's SharedSecretEncryptionPublicKey.
We use a custom encryption scheme to be more space-efficient (compared to standard AEAD schemes, nacl crypto_box, etc...), which saves gas in transmission to the OCR2Aggregator.
func XXXEncryptSharedSecret ¶
func XXXEncryptSharedSecret( keys []types.ConfigEncryptionPublicKey, sharedSecret *[SharedSecretSize]byte, rand io.Reader, ) SharedSecretEncryptions
XXXEncryptSharedSecret constructs a SharedSecretEncryptions from a set of SharedSecretEncryptionPublicKeys, the sharedSecret, and a cryptographic randomness source
func XXXEncryptSharedSecretInternal ¶
func XXXEncryptSharedSecretInternal( publicKeys []types.ConfigEncryptionPublicKey, sharedSecret *[SharedSecretSize]byte, sk *[32]byte, ) SharedSecretEncryptions
XXXEncryptSharedSecretInternal constructs a SharedSecretEncryptions from a set of SharedSecretEncryptionPublicKeys, the sharedSecret, and an ephemeral secret key sk
func (SharedSecretEncryptions) Decrypt ¶
func (e SharedSecretEncryptions) Decrypt(oid commontypes.OracleID, k types.OffchainKeyring) (*[SharedSecretSize]byte, error)
Decrypt returns the sharedSecret
func (SharedSecretEncryptions) Equal ¶
func (e SharedSecretEncryptions) Equal(e2 SharedSecretEncryptions) bool