Open benjaminstrasser opened 4 years ago
Hi benjaminstrasser
I am also using the sha256.circom file and compiled using circom circuit.circom --r1cs --wasm --sym
my circuit file:
include "sha256.circom";
template x() {
signal private input in[256];
signal output out[256];
component H2 = Sha256(256);
for (var v = 0; v< 256; v++) {
H2.in[v] <== in[v];
}
for (var k = 0; k< 256; k++) {
out[k] <== H2.out[k];
}
}
component main = x();
But I am unable to generate the hash output & it doesn't work when I put letters as input. Any solution?
Compiling the SHA256 circuit is very memory-intensive. In order to get it to compile, I had to bump up the max_old_space_size option to 8GB in node.
If invoking circom with npx, you'd do this: npx --node-arg=--max-old-space-size=8000 circom circuits/sha256.circom
If invoking the globally installed version, you'd do something like: node --max-old-space-size=8000 $(which circom) circuits/sha256.circom
For posterity, at some point the --node-arg
parameter to npx will be deprecated in favour of --node-options
.
I downloaded circom via
npm i -g circom
I downloaded circomlib via
npm i circomlib
After compiling this piece of code I encounter a problem.
I encounter this problem
When I try to compile the Sha256 with 1 bit It doesnt throw the error but creates an unfinised json
Any suggestions what could cause this problem ?