Documentation
¶
Index ¶
- Variables
- func Challenge(data io.Reader, commitments []common.Hash) (types.Challenge, error)
- type StateMatrix
- func (d *StateMatrix) AbsorbUpTo(in io.Reader, maxLen int) (types.InputData, error)
- func (d *StateMatrix) Hash() (h common.Hash)
- func (d *StateMatrix) PackState() []byte
- func (d *StateMatrix) PoststateWithProof() (types.Leaf, merkle.Proof)
- func (d *StateMatrix) PrestateWithProof() (types.Leaf, merkle.Proof)
- func (d *StateMatrix) StateCommitment() common.Hash
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type StateMatrix ¶
type StateMatrix struct {
// contains filtered or unexported fields
}
StateMatrix implements a stateful keccak sponge with the ability to create state commitments after each permutation
func NewStateMatrix ¶
func NewStateMatrix() *StateMatrix
NewStateMatrix creates a new state matrix initialized with the initial, zero keccak block.
func (*StateMatrix) AbsorbUpTo ¶
func (*StateMatrix) Hash ¶
func (d *StateMatrix) Hash() (h common.Hash)
Hash finalizes the keccak permutation and returns the final hash. No further leaves can be absorbed after this is called
func (*StateMatrix) PackState ¶
func (d *StateMatrix) PackState() []byte
PackState packs the state in to the solidity ABI encoding required for the state matrix
func (*StateMatrix) PoststateWithProof ¶
func (d *StateMatrix) PoststateWithProof() (types.Leaf, merkle.Proof)
PoststateWithProof returns the poststate leaf with its merkle proof.
func (*StateMatrix) PrestateWithProof ¶
func (d *StateMatrix) PrestateWithProof() (types.Leaf, merkle.Proof)
PrestateWithProof returns the prestate leaf with its merkle proof.
func (*StateMatrix) StateCommitment ¶
func (d *StateMatrix) StateCommitment() common.Hash
StateCommitment returns the state commitment for the current state matrix. Additional data may be absorbed after calling this method.