Documentation ¶
Index ¶
- Constants
- func EncryptSecret(pubKeyEncoded []byte, secret SharedEnclaveSecret, logger gethlog.Logger) (common.EncryptedSharedEnclaveSecret, error)
- func GeneratePublicRandomness() ([]byte, error)
- func GetObscuroKey(logger gethlog.Logger) *ecdsa.PrivateKey
- func PerTransactionRnd(privateRnd []byte, tCount int) []byte
- func PrivateRollupRnd(publicRnd []byte, secret []byte) []byte
- type SharedEnclaveSecret
- type TransactionBlobCrypto
- type TransactionBlobCryptoImpl
Constants ¶
View Source
const ( // RollupEncryptionKeyHex is the AES key used to encrypt and decrypt the transaction blob in rollups. // todo (#1053) - replace this fixed key with derived, rotating keys. RollupEncryptionKeyHex = "bddbc0d46a0666ce57a466168d99c1830b0c65e052d77188f2cbfc3f6486588c" // NonceLength is the nonce's length in bytes for encrypting and decrypting transactions. NonceLength = 12 )
Variables ¶
This section is empty.
Functions ¶
func EncryptSecret ¶
func EncryptSecret(pubKeyEncoded []byte, secret SharedEnclaveSecret, logger gethlog.Logger) (common.EncryptedSharedEnclaveSecret, error)
func GeneratePublicRandomness ¶
GeneratePublicRandomness - generate 32 bytes of randomness, which will be exposed in the rollup header.
func GetObscuroKey ¶
func GetObscuroKey(logger gethlog.Logger) *ecdsa.PrivateKey
func PerTransactionRnd ¶
PerTransactionRnd - calculates a per tx random value
func PrivateRollupRnd ¶
PrivateRollupRnd - combine public randomness with private randomness in a way that protects the secret.
Types ¶
type SharedEnclaveSecret ¶
type SharedEnclaveSecret [sharedSecretLen]byte
SharedEnclaveSecret - the entropy
func DecryptSecret ¶
func DecryptSecret(secret common.EncryptedSharedEnclaveSecret, privateKey *ecdsa.PrivateKey) (*SharedEnclaveSecret, error)
func GenerateEntropy ¶
func GenerateEntropy(logger gethlog.Logger) SharedEnclaveSecret
type TransactionBlobCrypto ¶
type TransactionBlobCrypto interface { Encrypt(transactions []*common.L2Tx) common.EncryptedTransactions Decrypt(encryptedTxs common.EncryptedTransactions) []*common.L2Tx }
TransactionBlobCrypto handles the encryption and decryption of the transaction blobs stored inside a rollup.
func NewTransactionBlobCryptoImpl ¶
func NewTransactionBlobCryptoImpl(logger gethlog.Logger) TransactionBlobCrypto
type TransactionBlobCryptoImpl ¶
type TransactionBlobCryptoImpl struct {
// contains filtered or unexported fields
}
func (TransactionBlobCryptoImpl) Decrypt ¶
func (t TransactionBlobCryptoImpl) Decrypt(encryptedTxs common.EncryptedTransactions) []*common.L2Tx
func (TransactionBlobCryptoImpl) Encrypt ¶
func (t TransactionBlobCryptoImpl) Encrypt(transactions []*common.L2Tx) common.EncryptedTransactions
todo (#1053) - modify this logic so that transactions with different reveal periods are in different blobs, as per the whitepaper.
Click to show internal directories.
Click to hide internal directories.