1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00

Merge pull request #816 from Zokrates/merge-back-070

Merge back 0.7.0
This commit is contained in:
Thibaut Schaeffer 2021-04-14 11:41:52 +02:00 committed by GitHub
commit 04e485ca0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 75 additions and 69 deletions

View file

@ -11,6 +11,7 @@ sudo: required
env: env:
global: global:
- CRATE_NAME=zokrates - CRATE_NAME=zokrates
matrix: matrix:
include: include:
@ -67,7 +68,7 @@ branches:
only: only:
# release tags # release tags
- /^\d+\.\d+\.\d+.*$/ - /^\d+\.\d+\.\d+.*$/
- master - deploy
notifications: notifications:
email: email:

View file

@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
## [Unreleased] ## [Unreleased]
https://github.com/Zokrates/ZoKrates/compare/latest...develop https://github.com/Zokrates/ZoKrates/compare/latest...develop
## [0.7.0] - 2021-04-09
### Release
- https://github.com/Zokrates/ZoKrates/releases/tag/0.7.0
### Changes
- Re-export embed functions as stdlib modules, add field to uint casts to stdlib (#801, @dark64)
- Change left `<<` and right `>>` shifts to take `u32` as a second parameter (#783, @schaeff)
- Introduce u64 type, add keccak{256,384,512} and sha3{256,384,512} hash functions to stdlib (#772, @dark64)
- Add negative `-` and positive `+` unary operators, restricting accepted expressions in some places (exponent) to allow for better parsing (#762, @schaeff)
- Make embed functions generic, enabling unpacking to any width at minimal cost (#754, @schaeff)
- Add global `--verbose` flag to CLI for verbose logging, add `--ztf` flag to `compile` command, deprecate `--light` flag as its behaviour is now a default. (#751, @dark64)
- Introduce constant generics for `u32` values. Introduce literal inference (#695, @schaeff)
## [0.6.4] - 2021-03-19 ## [0.6.4] - 2021-03-19
### Release ### Release
- https://github.com/Zokrates/ZoKrates/releases/tag/0.6.4 - https://github.com/Zokrates/ZoKrates/releases/tag/0.6.4

18
Cargo.lock generated
View file

@ -2258,7 +2258,7 @@ dependencies = [
[[package]] [[package]]
name = "zokrates_abi" name = "zokrates_abi"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"serde", "serde",
"serde_derive", "serde_derive",
@ -2269,7 +2269,7 @@ dependencies = [
[[package]] [[package]]
name = "zokrates_cli" name = "zokrates_cli"
version = "0.6.4" version = "0.7.0"
dependencies = [ dependencies = [
"assert_cli", "assert_cli",
"bincode", "bincode",
@ -2294,7 +2294,7 @@ version = "0.1.0"
[[package]] [[package]]
name = "zokrates_core" name = "zokrates_core"
version = "0.5.4" version = "0.6.0"
dependencies = [ dependencies = [
"ark-bls12-377", "ark-bls12-377",
"ark-bn254", "ark-bn254",
@ -2335,7 +2335,7 @@ dependencies = [
[[package]] [[package]]
name = "zokrates_core_test" name = "zokrates_core_test"
version = "0.1.5" version = "0.2.0"
dependencies = [ dependencies = [
"zokrates_test", "zokrates_test",
"zokrates_test_derive", "zokrates_test_derive",
@ -2343,7 +2343,7 @@ dependencies = [
[[package]] [[package]]
name = "zokrates_embed" name = "zokrates_embed"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"bellman_ce", "bellman_ce",
"sapling-crypto_ce", "sapling-crypto_ce",
@ -2351,7 +2351,7 @@ dependencies = [
[[package]] [[package]]
name = "zokrates_field" name = "zokrates_field"
version = "0.3.8" version = "0.4.0"
dependencies = [ dependencies = [
"ark-bls12-377", "ark-bls12-377",
"ark-bn254", "ark-bn254",
@ -2381,7 +2381,7 @@ dependencies = [
[[package]] [[package]]
name = "zokrates_parser" name = "zokrates_parser"
version = "0.1.6" version = "0.2.0"
dependencies = [ dependencies = [
"glob 0.2.11", "glob 0.2.11",
"pest", "pest",
@ -2390,7 +2390,7 @@ dependencies = [
[[package]] [[package]]
name = "zokrates_pest_ast" name = "zokrates_pest_ast"
version = "0.1.5" version = "0.2.0"
dependencies = [ dependencies = [
"from-pest", "from-pest",
"glob 0.2.11", "glob 0.2.11",
@ -2402,7 +2402,7 @@ dependencies = [
[[package]] [[package]]
name = "zokrates_stdlib" name = "zokrates_stdlib"
version = "0.1.8" version = "0.2.0"
dependencies = [ dependencies = [
"fs_extra", "fs_extra",
"zokrates_test", "zokrates_test",

View file

@ -1,7 +0,0 @@
def id<N>() -> u32:
return N
def main():
assert(id::<5>() == 5)
assert(id::<6>() == 6)
return

View file

@ -3,4 +3,8 @@
# Exit if any subcommand fails # Exit if any subcommand fails
set -e set -e
cargo build if [ -n "$WITH_LIBSNARK" ]; then
cargo -Z package-features build --package zokrates_cli --features="libsnark"
else
cargo build
fi

View file

@ -1 +0,0 @@
Introduce constant generics for `u32` values. Introduce literal inference

View file

@ -1 +0,0 @@
Add global `--verbose` flag to CLI for verbose logging, add `--ztf` flag to `compile` command, deprecate `--light` flag as its behaviour is now a default.

View file

@ -1 +0,0 @@
Make embed functions generic, enabling unpacking to any width at minimal cost

View file

@ -1 +0,0 @@
Add negative `-` and positive `+` unary operators, restricting accepted expressions in some places (exponent) to allow for better parsing

View file

@ -1 +0,0 @@
Introduce u64 type, add keccak{256,384,512} and sha3{256,384,512} hash functions to stdlib

View file

@ -1 +0,0 @@
Change left `<<` and right `>>` shifts to take `u32` as a second parameter

View file

@ -1 +0,0 @@
Re-export embed functions as stdlib modules, add field to uint casts to stdlib

View file

@ -28,7 +28,14 @@ main() {
test -f Cargo.lock || cargo generate-lockfile test -f Cargo.lock || cargo generate-lockfile
cross build --bin zokrates --target $TARGET --release case $TRAVIS_OS_NAME in
linux)
cross build --bin zokrates --package zokrates_cli --features="libsnark" --target $TARGET --release
;;
*)
cross build --bin zokrates --package zokrates_cli --target $TARGET --release
;;
esac
# Package artifacts # Package artifacts
# Binary # Binary

View file

@ -1,11 +0,0 @@
def foo<N>(field[N] x) -> field[N]:
return x
def bar<N>(field[N] x) -> field[N]:
field[N] r = x
return r
def main(field[3] x) -> field[2]:
field[2] z = foo(x)[0..2]
return bar(z)

View file

@ -3,4 +3,8 @@
# Exit if any subcommand fails # Exit if any subcommand fails
set -e set -e
cargo test --release -- --ignored --test-threads=1 if [ -n "$WITH_LIBSNARK" ]; then
cargo -Z package-features test --release --package zokrates_cli --features="libsnark" -- --ignored --test-threads=1
else
cargo test --release -- --ignored --test-threads=1
fi

View file

@ -3,4 +3,8 @@
# Exit if any subcommand fails # Exit if any subcommand fails
set -e set -e
cargo test --release -- --test-threads=1 if [ -n "$WITH_LIBSNARK" ]; then
cargo -Z package-features test --release --package zokrates_cli --features="libsnark" -- --test-threads=1
else
cargo test --release -- --test-threads=1
fi

View file

@ -1,12 +1,12 @@
[package] [package]
name = "zokrates_abi" name = "zokrates_abi"
version = "0.1.3" version = "0.1.4"
authors = ["Thibaut Schaeffer <thibaut@schaeff.fr>"] authors = ["Thibaut Schaeffer <thibaut@schaeff.fr>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
zokrates_field = { version = "0.3", path = "../zokrates_field", default-features = false } zokrates_field = { version = "0.4", path = "../zokrates_field", default-features = false }
zokrates_core = { version = "0.5", path = "../zokrates_core", default-features = false } zokrates_core = { version = "0.6", path = "../zokrates_core", default-features = false }
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
serde_json = "1.0" serde_json = "1.0"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "zokrates_cli" name = "zokrates_cli"
version = "0.6.4" version = "0.7.0"
authors = ["Jacob Eberhardt <jacob.eberhardt@tu-berlin.de>", "Dennis Kuhnert <mail@kyroy.com>", "Thibaut Schaeffer <thibaut@schaeff.fr>"] authors = ["Jacob Eberhardt <jacob.eberhardt@tu-berlin.de>", "Dennis Kuhnert <mail@kyroy.com>", "Thibaut Schaeffer <thibaut@schaeff.fr>"]
repository = "https://github.com/JacobEberhardt/ZoKrates.git" repository = "https://github.com/JacobEberhardt/ZoKrates.git"
edition = "2018" edition = "2018"
@ -16,9 +16,9 @@ cfg-if = "0.1"
clap = "2.26.2" clap = "2.26.2"
bincode = "0.8.0" bincode = "0.8.0"
regex = "0.2" regex = "0.2"
zokrates_field = { version = "0.3", path = "../zokrates_field", default-features = false } zokrates_field = { version = "0.4", path = "../zokrates_field", default-features = false }
zokrates_abi = { version = "0.1", path = "../zokrates_abi" } zokrates_abi = { version = "0.1", path = "../zokrates_abi" }
zokrates_core = { version = "0.5", path = "../zokrates_core", default-features = false } zokrates_core = { version = "0.6", path = "../zokrates_core", default-features = false }
zokrates_fs_resolver = { version = "0.5", path = "../zokrates_fs_resolver"} zokrates_fs_resolver = { version = "0.5", path = "../zokrates_fs_resolver"}
serde_json = "1.0" serde_json = "1.0"
dirs = "3.0.1" dirs = "3.0.1"

View file

@ -1,2 +0,0 @@
def main():
return

View file

@ -1,6 +1,6 @@
[package] [package]
name = "zokrates_core" name = "zokrates_core"
version = "0.5.4" version = "0.6.0"
edition = "2018" edition = "2018"
authors = ["Jacob Eberhardt <jacob.eberhardt@tu-berlin.de>", "Dennis Kuhnert <mail@kyroy.com>"] authors = ["Jacob Eberhardt <jacob.eberhardt@tu-berlin.de>", "Dennis Kuhnert <mail@kyroy.com>"]
repository = "https://github.com/JacobEberhardt/ZoKrates" repository = "https://github.com/JacobEberhardt/ZoKrates"
@ -28,10 +28,10 @@ serde_json = "1.0"
bincode = "0.8.0" bincode = "0.8.0"
hex = "0.4.2" hex = "0.4.2"
regex = "0.2" regex = "0.2"
zokrates_field = { version = "0.3.0", path = "../zokrates_field", default-features = false } zokrates_field = { version = "0.4.0", path = "../zokrates_field", default-features = false }
zokrates_pest_ast = { version = "0.1.0", path = "../zokrates_pest_ast" } zokrates_pest_ast = { version = "0.2.0", path = "../zokrates_pest_ast" }
zokrates_common = { path = "../zokrates_common" } zokrates_common = { path = "../zokrates_common" }
zokrates_embed = { path = "../zokrates_embed" } zokrates_embed = { version = "0.1.0", path = "../zokrates_embed" }
getrandom = { version = "0.2", features = ["js"] } getrandom = { version = "0.2", features = ["js"] }
rand_0_4 = { version = "0.4", package = "rand" } rand_0_4 = { version = "0.4", package = "rand" }
rand_0_7 = { version = "0.7", package = "rand" } rand_0_7 = { version = "0.7", package = "rand" }

View file

@ -25,7 +25,7 @@ pub fn prepare_public_inputs<T: Field>(public_inputs: Vec<T>) -> (Vec<[u8; 32]>,
let mut public_inputs_arr: Vec<[u8; 32]> = vec![[0u8; 32]; public_inputs_length]; let mut public_inputs_arr: Vec<[u8; 32]> = vec![[0u8; 32]; public_inputs_length];
for (index, value) in public_inputs.into_iter().enumerate() { for (index, value) in public_inputs.into_iter().enumerate() {
public_inputs_arr[index] = vec_as_u8_32_array(&value.into_byte_vector()); public_inputs_arr[index] = vec_as_u8_32_array(&value.to_byte_vector());
} }
(public_inputs_arr, public_inputs_length) (public_inputs_arr, public_inputs_length)
@ -62,21 +62,21 @@ pub fn prepare_setup<T: Field>(
a_vec.push(( a_vec.push((
row as i32, row as i32,
idx as i32, idx as i32,
vec_as_u8_32_array(&val.into_byte_vector()), vec_as_u8_32_array(&val.to_byte_vector()),
)); ));
} }
for &(idx, ref val) in &b[row] { for &(idx, ref val) in &b[row] {
b_vec.push(( b_vec.push((
row as i32, row as i32,
idx as i32, idx as i32,
vec_as_u8_32_array(&val.into_byte_vector()), vec_as_u8_32_array(&val.to_byte_vector()),
)); ));
} }
for &(idx, ref val) in &c[row] { for &(idx, ref val) in &c[row] {
c_vec.push(( c_vec.push((
row as i32, row as i32,
idx as i32, idx as i32,
vec_as_u8_32_array(&val.into_byte_vector()), vec_as_u8_32_array(&val.to_byte_vector()),
)); ));
} }
} }
@ -177,10 +177,10 @@ pub fn prepare_generate_proof<T: Field>(
//convert inputs //convert inputs
for (index, value) in public_inputs.into_iter().enumerate() { for (index, value) in public_inputs.into_iter().enumerate() {
public_inputs_arr[index] = vec_as_u8_32_array(&value.into_byte_vector()); public_inputs_arr[index] = vec_as_u8_32_array(&value.to_byte_vector());
} }
for (index, value) in private_inputs.into_iter().enumerate() { for (index, value) in private_inputs.into_iter().enumerate() {
private_inputs_arr[index] = vec_as_u8_32_array(&value.into_byte_vector()); private_inputs_arr[index] = vec_as_u8_32_array(&value.to_byte_vector());
} }
( (

View file

@ -1,6 +1,6 @@
[package] [package]
name = "zokrates_core_test" name = "zokrates_core_test"
version = "0.1.5" version = "0.2.0"
authors = ["schaeff <thibaut@schaeff.fr>"] authors = ["schaeff <thibaut@schaeff.fr>"]
edition = "2018" edition = "2018"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "zokrates_embed" name = "zokrates_embed"
version = "0.1.1" version = "0.1.2"
authors = ["schaeff <thibaut@schaeff.fr>"] authors = ["schaeff <thibaut@schaeff.fr>"]
edition = "2018" edition = "2018"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "zokrates_field" name = "zokrates_field"
version = "0.3.8" version = "0.4.0"
authors = ["Thibaut Schaeffer <thibaut@schaeff.fr>", "Guillaume Ballet <gballet@gmail.com>"] authors = ["Thibaut Schaeffer <thibaut@schaeff.fr>", "Guillaume Ballet <gballet@gmail.com>"]
edition = "2018" edition = "2018"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "zokrates_js" name = "zokrates_js"
version = "1.0.28" version = "1.0.29"
authors = ["Darko Macesic"] authors = ["Darko Macesic"]
edition = "2018" edition = "2018"

View file

@ -2,7 +2,7 @@
"name": "zokrates-js", "name": "zokrates-js",
"main": "index.js", "main": "index.js",
"author": "Darko Macesic <darem966@gmail.com>", "author": "Darko Macesic <darem966@gmail.com>",
"version": "1.0.28", "version": "1.0.29",
"keywords": [ "keywords": [
"zokrates", "zokrates",
"wasm-bindgen", "wasm-bindgen",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "zokrates_parser" name = "zokrates_parser"
version = "0.1.6" version = "0.2.0"
authors = ["JacobEberhardt <jacob.eberhardt@tu-berlin.de>"] authors = ["JacobEberhardt <jacob.eberhardt@tu-berlin.de>"]
edition = "2018" edition = "2018"

View file

@ -1,11 +1,11 @@
[package] [package]
name = "zokrates_pest_ast" name = "zokrates_pest_ast"
version = "0.1.5" version = "0.2.0"
authors = ["schaeff <thibaut@schaeff.fr>"] authors = ["schaeff <thibaut@schaeff.fr>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
zokrates_parser = { version = "0.1.0", path = "../zokrates_parser" } zokrates_parser = { version = "0.2.0", path = "../zokrates_parser" }
pest = "2.0" pest = "2.0"
pest-ast = "0.3.3" pest-ast = "0.3.3"
from-pest = "0.3.1" from-pest = "0.3.1"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "zokrates_stdlib" name = "zokrates_stdlib"
version = "0.1.8" version = "0.2.0"
authors = ["Stefan Deml <stefandeml@gmail.com>", "schaeff <thibaut@schaeff.fr>"] authors = ["Stefan Deml <stefandeml@gmail.com>", "schaeff <thibaut@schaeff.fr>"]
edition = "2018" edition = "2018"

View file

@ -5,8 +5,8 @@ authors = ["schaeff <thibaut@schaeff.fr>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
zokrates_field = { version = "0.3", path = "../zokrates_field" } zokrates_field = { version = "0.4", path = "../zokrates_field" }
zokrates_core = { version = "0.5", path = "../zokrates_core" } zokrates_core = { version = "0.6", path = "../zokrates_core" }
zokrates_fs_resolver = { version = "0.5", path = "../zokrates_fs_resolver" } zokrates_fs_resolver = { version = "0.5", path = "../zokrates_fs_resolver" }
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"