Zokrates / ZoKrates

A toolbox for zkSNARKs on Ethereum
https://zokrates.github.io
GNU Lesser General Public License v3.0
1.8k stars 360 forks source link

sha256 compilation issue #1374

Open TheYangCode opened 2 months ago

TheYangCode commented 2 months ago
import "hashes/sha256/sha256Padded" as sha256;

def main(u8[7417]input) ->u32[8]{

    u32[8] hash = sha256(input);

    return hash;
}

The above is my code, but it always gets killed during compilation. Is it because it requires too much memory? How should I adjust it?

jswalens commented 1 month ago

Probably the input is so large that it runs out of memory during compilation. I'm afraid using such large inputs for SHA256 is not the way to go using Zokrates. You could maybe use the Poseidon hash?