• Piotr Dyraga's avatar
    core/vm, crypto/blake2b: add BLAKE2b compression func at 0x09 · 2890f060
    Piotr Dyraga authored
    The precompile at 0x09 wraps the BLAKE2b F compression function:
    https://tools.ietf.org/html/rfc7693#section-3.2
    
    The precompile requires 6 inputs tightly encoded, taking exactly 213
    bytes, as explained below.
    
    - `rounds` - the number of rounds - 32-bit unsigned big-endian word
    - `h` - the state vector - 8 unsigned 64-bit little-endian words
    - `m` - the message block vector - 16 unsigned 64-bit little-endian words
    - `t_0, t_1` - offset counters - 2 unsigned 64-bit little-endian words
    - `f` - the final block indicator flag - 8-bit word
    
    [4 bytes for rounds][64 bytes for h][128 bytes for m][8 bytes for t_0]
    [8 bytes for t_1][1 byte for f]
    
    The boolean `f` parameter is considered as `true` if set to `1`.
    The boolean `f` parameter is considered as `false` if set to `0`.
    All other values yield an invalid encoding of `f` error.
    
    The precompile should compute the F function as specified in the RFC
    (https://tools.ietf.org/html/rfc7693#section-3.2) and return the updated
    state vector `h` with unchanged encoding (little-endian).
    
    See EIP-152 for details.
    2890f060
Name
Last commit
Last update
..
runtime Loading commit data...
testdata Loading commit data...
analysis.go Loading commit data...
analysis_test.go Loading commit data...
common.go Loading commit data...
contract.go Loading commit data...
contracts.go Loading commit data...
contracts_test.go Loading commit data...
doc.go Loading commit data...
eips.go Loading commit data...
errors.go Loading commit data...
evm.go Loading commit data...
gas.go Loading commit data...
gas_table.go Loading commit data...
gas_table_test.go Loading commit data...
gen_structlog.go Loading commit data...
instructions.go Loading commit data...
instructions_test.go Loading commit data...
int_pool_verifier.go Loading commit data...
int_pool_verifier_empty.go Loading commit data...
interface.go Loading commit data...
interpreter.go Loading commit data...
intpool.go Loading commit data...
intpool_test.go Loading commit data...
jump_table.go Loading commit data...
logger.go Loading commit data...
logger_json.go Loading commit data...
logger_test.go Loading commit data...
memory.go Loading commit data...
memory_table.go Loading commit data...
opcodes.go Loading commit data...
stack.go Loading commit data...
stack_table.go Loading commit data...