1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

resolve PR comments

This commit is contained in:
sdeml 2019-01-31 21:06:43 +01:00
parent 94f855ede8
commit fe6396950b
3 changed files with 15 additions and 2 deletions

View file

@ -14,7 +14,7 @@ jobs:
command: cargo generate-lockfile command: cargo generate-lockfile
- restore_cache: - restore_cache:
keys: keys:
- v5-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} - v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run: - run:
name: Build libsnark name: Build libsnark
command: LIBSNARK_SOURCE_PATH=$HOME/libsnark ./build_libsnark.sh command: LIBSNARK_SOURCE_PATH=$HOME/libsnark ./build_libsnark.sh

View file

@ -1,7 +1,6 @@
import "PACKING/pack128" as pack128 import "PACKING/pack128" as pack128
import "PACKING/unpack128" as unpack128 import "PACKING/unpack128" as unpack128
import "./512bit.code" as sha256 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 // 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. // bits (big endian), concatenates them and applies sha256.
// It then returns an array of two field elements, each representing 128 bits of the result. // It then returns an array of two field elements, each representing 128 bits of the result.

View file

@ -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 import "hashes/sha256/512bitPadded.code" as sha256
def main() -> (field): def main() -> (field):