Blake2f precompile — address 0x09 (EIP-152).
Implements the Blake2b compression function F.
Gas schedule
Gas cost is exactly the rounds field from input bytes 0..3 (uint32,
big-endian).
Input format
Input must be exactly 213 bytes:
- bytes
0..3—rounds(uint32, big-endian) - bytes
4..67—h(8 × 64-bit words, little-endian) - bytes
68..195—m(16 × 64-bit words, little-endian) - bytes
196..211—t(2 × 64-bit words, little-endian) - byte
212—ffinal block flag (0or1only)
Output is 64 bytes: the 8 updated state words in little-endian.
Summary
Functions
Executes the Blake2f precompile.
Functions
@spec execute(binary(), non_neg_integer()) :: {:ok, binary(), non_neg_integer()} | {:error, :invalid_input | :out_of_gas}
Executes the Blake2f precompile.
Returns {:ok, output, gas_used} on success where output is 64 bytes and
gas_used == rounds.
Returns:
{:error, :invalid_input}if input length is not 213 bytes or final flag is not0or1{:error, :out_of_gas}ifgas_limit < rounds