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 { 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 }DiffieHellmanPoint [
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 EncryptSharedSecret ¶ added in v0.1.1
func EncryptSharedSecret( keys []types.ConfigEncryptionPublicKey, sharedSecret *[SharedSecretSize]byte, rand io.Reader, ) (SharedSecretEncryptions, error)
EncryptSharedSecret constructs a SharedSecretEncryptions from a set of SharedSecretEncryptionPublicKeys, the sharedSecret, and a cryptographic randomness source
func EncryptSharedSecretDeterministic ¶ added in v0.1.1
func EncryptSharedSecretDeterministic( publicKeys []types.ConfigEncryptionPublicKey, sharedSecret *[SharedSecretSize]byte, ephemeralSk *[curve25519.ScalarSize]byte, ) (SharedSecretEncryptions, error)
EncryptSharedSecretDeterministic constructs a SharedSecretEncryptions from a set of ConfigEncryptionPublicKeys, the sharedSecret, and an ephemeral secret key
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