sha512
/
1.0.1
sha512 1.0.1
Install from the command line:
Learn more about npm packages
$ npm install @electron-labs/sha512@1.0.1
Install via package.json:
"@electron-labs/sha512": "1.0.1"
About this version
A circuit to compute SHA512 hash written in Circom.
npm install
npm test
include "sha512/sha512/sha512.circom";
include "circomlib/binsum.circom"; // make sure to include your copy of binsum.circom from circomblib
var INPUT_BITS = 1024; // number of bits of the input message
component sha512 = Sha512(INPUT_BITS);
for (var i = 0; i < INPUT_BITS; i++) {
sha512.in[i] <== nullifierBits[i];
}
for (var i = 0; i < 512; i++) {
out[i] <== sha512.out[i];
}
The circuit only uses <==
and doesn't use <--
thus ensuring that the circuit correctly generates all the constraints.