Documentation ¶
Overview ¶
Methods for operations relating to SSZ, a serialization method used in the Ethereum consensus layer, for out of circuit data. To learn more, refer to https://ethereum.org/en/developers/docs/data-structures-and-encoding/ssz/.
Index ¶
- func Hash(data []byte) [32]byte
- func HashTreeRoot(leaves [][32]byte) [32]byte
- func NewBytes32FromBytesLeftPad(data []byte) [32]byte
- func NewBytes32FromBytesRightPad(data []byte) [32]byte
- func NewBytes32FromU64LE(v uint64) [32]byte
- func RestoreMerkleRoot(leaf [32]byte, proof [][32]byte, gindex int) [32]byte
- func VerifyProof(root [32]byte, leaf [32]byte, proof [][32]byte, gindex int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashTreeRoot ¶
Computes the root of a SSZ tree given a list of leaves.
func NewBytes32FromBytesLeftPad ¶
Converts a byte slice to 32 byte array with left padding.
func NewBytes32FromBytesRightPad ¶
Converts a byte slice to 32 byte array with right padding.
func NewBytes32FromU64LE ¶
Converts a u64 to a 32 byte array in little endian.
func RestoreMerkleRoot ¶
Computes the expected root of a SSZ proof given a leaf, proof, and gindex.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.