keccak-circom
/
0.0.3
keccak-circom 0.0.3
Install from the command line:
Learn more about npm packages
$ npm install @electron-labs/keccak-circom@0.0.3
Install via package.json:
"@electron-labs/keccak-circom": "0.0.3"
About this version
Keccak256 hash function (ethereum version) implemented in circom. Spec: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf
Warning: WIP, this is an experimental repo.
Initial version works, compatible with Ethereum version of Keccak256.
// make sure to include from your copy of circomlib
include "circomlib/circuits/gates.circom";
include "circomlib/circuits/sha256/xor3.circom";
include "circomlib/circuits/sha256/shift.circom";
var INPUT_BITS = 1024; // number of bits of the input message as a multiple of 8 (one byte)
component keccak = Keccak(INPUT_BITS, 256);
for (var i = 0; i < INPUT_BITS; i++) {
keccak.in[i] <== msg[i];
}
for (var i = 0; i < 512; i++) {
out[i] <== keccak.out[i];
}
It needs around 150848
(151k
) constraints.
For context: Rapidsnark proof generation time:
- 1.1M constraints -> 7 seconds (8 CPU)
- 128M constraints -> <2min (64 CPU)
Details
- keccak-circom
- Electron-Labs
- over 2 years ago
- GPL-3.0
- 5 dependencies
Assets
- keccak-circom-0.0.3-npm.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0