Closed filippodp closed 5 years ago
This is just the "compress" function of SHA256 protocol, not the entire protocol, and requires input to be 512 bits. (The full protocol can take in any size input but also must run the compress function twice so it less efficient.)
If you need the full protocol, look at https://github.com/kobigurk/sha256_ethereum
Thanks!
I am working with
sha256_compression_function_gadget
, in this way, I created the protoboard, twodigest_variable
, the first for the input, the second for the output. Token variable is composed by threebit_vector
variables piped. I assigned the value of the token to the input digest_variable (in the witness) and then I compress it.At the end I print the value (in bits) of both
digest_variable
,up to now there are no problems.If I change the value of
bit_vector a
from12345
to5
, I recompile and re-run (pretty stupid I know), the bits stored intotoken_hash_output
did not change (input did), I got exactly the same output. There are some problem with the library or am I doing something wrong?NB. If the token was composed only piping
a
andb
the program works; changeSHA256_digest_size * 2
accordingly.NB2. If I change the value of
bit_vector c
from111213
to1
,token_hash_output
bits change, seems that this gadget tooks only the last 512 bits.