# `EEVM.Crypto.Keccak`
[🔗](https://github.com/mw2000/eevm/blob/v0.1.0/lib/eevm/crypto/keccak.ex#L1)

Keccak-256, the hash Ethereum calls `keccak256`, in pure Elixir.

This is Keccak[r = 1088, c = 512] with the original submission's
`pad10*1` padding: the first padding byte is `0x01`. SHA3-256 (FIPS 202)
is the same sponge with `0x06`, so the two give different digests.

The permutation is Keccak-f[1600] from
[FIPS 202 §3](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf):
24 rounds of θ, ρ, π, χ and ι over a 5×5 array of 64-bit lanes.

## Example

    iex> EEVM.Crypto.Keccak.hash_256("") |> Base.encode16(case: :lower)
    "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"

# `hash_256`

```elixir
@spec hash_256(binary()) :: &lt;&lt;_::256&gt;&gt;
```

Returns the 32-byte Keccak-256 digest of `message`.

## Example

    iex> EEVM.Crypto.Keccak.hash_256("abc") |> Base.encode16(case: :lower)
    "4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
