NethermindEth / blockifier

Blockifier is a Rust implementation for the transaction-executing component in the StarkNet sequencer, in charge of creating state diffs and blocks.
Apache License 2.0
1 stars 4 forks source link

Fix Native Keccak #36

Closed rodrigo-pino closed 5 months ago

rodrigo-pino commented 5 months ago

Keccak is failing. It is producing the wrong hash value.

    #[external(v0)]
    fn test_keccak(ref self: ContractState) {
        let mut input: Array::<u256> = Default::default();
        input.append(u256 { low: 1, high: 0 });

        let res = keccak::keccak_u256s_le_inputs(input.span());
        assert(res.low == 0x587f7cc3722e9654ea3963d5fe8c0748, 'Wrong hash value');
        assert(res.high == 0xa5963aa610cb75ba273817bce5f8c48f, 'Wrong hash value');
    }
rodrigo-pino commented 5 months ago

Solved on #42