diff --git a/.circleci/config.yml b/.circleci/config.yml index b92a302e..ee59e825 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ jobs: command: cargo generate-lockfile - restore_cache: keys: - - v5-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} + - v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} - run: name: Build libsnark command: LIBSNARK_SOURCE_PATH=$HOME/libsnark ./build_libsnark.sh diff --git a/stdlib/hashes/sha256/512bitPacked.code b/stdlib/hashes/sha256/512bitPacked.code index 77be38eb..21da2f77 100644 --- a/stdlib/hashes/sha256/512bitPacked.code +++ b/stdlib/hashes/sha256/512bitPacked.code @@ -1,7 +1,6 @@ import "PACKING/pack128" as pack128 import "PACKING/unpack128" as unpack128 import "./512bit.code" as sha256 -//FIXME: delete packed stldib // A function that takes an array of 4 field elements as inputs, unpacks each of them to 128 // bits (big endian), concatenates them and applies sha256. // It then returns an array of two field elements, each representing 128 bits of the result. diff --git a/zokrates_cli/examples/TestStdlib/hashes/sha256/test512bitPadded.code b/zokrates_cli/examples/TestStdlib/hashes/sha256/test512bitPadded.code index 3c6f2939..06ba66e2 100644 --- a/zokrates_cli/examples/TestStdlib/hashes/sha256/test512bitPadded.code +++ b/zokrates_cli/examples/TestStdlib/hashes/sha256/test512bitPadded.code @@ -1,3 +1,17 @@ +// Python code used to create test vector: +// import hashlib + +// preimage = bytes.fromhex('00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\ +// 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05') + +// bin(int(preimage.hex(), 16)) +// # '0b101' + +// digest = hashlib.sha256(preimage).hexdigest() +// # digest = 'c6481e22c5ff4164af680b8cfaa5e8ed3120eeff89c4f307c4a6faaae059ce10' + +// bin(int(digest, 16)) +// # '0b1100011001001000000111100010001011000101111111110100000101100100101011110110100000001011100011001111101010100101111010001110110100110001001000001110111011111111100010011100010011110011000001111100010010100110111110101010101011100000010110011100111000010000' import "hashes/sha256/512bitPadded.code" as sha256 def main() -> (field):