keccak256-circom/README.md
README.mdRaw
1# keccak256-circom [](https://github.com/vocdoni/keccak256-circom/actions?query=workflow%3ATest)
2
3Keccak256 hash function (ethereum version) implemented in [circom](https://github.com/iden3/circom). Spec: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf
4
5**Warning**: WIP, this is an experimental repo.
6
7## Status
8Initial version works, compatible with Ethereum version of Keccak256.
9
10It needs around `150848` (`151k`) constraints.
11> For context: [Rapidsnark](https://github.com/iden3/rapidsnark) proof generation time:
12> - 1.1M constraints -> 7 seconds (8 CPU)
13> - 128M constraints -> <2min (64 CPU)
14
15## Usage
16- import the lib in the `package.json`:
17```
18"dependencies": {
19 "keccak256-circom": "git+https://github.com/vocdoni/keccak256-circom"
20}
21```
22
23- Usage:
24```
25pragma circom 2.0.0;
26
27include "../node_modules/keccak256-circom/circuits/keccak.circom";
28
29// for a input & output of 32 bytes:
30component main = Keccak(32*8, 32*8);
31```