From 55fa366730bb71429dd6e11c913a06e3ab42fe66 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 11:31:01 +0100 Subject: [PATCH 01/10] ff 0.7.0 --- bellman/Cargo.toml | 2 +- bls12_381/Cargo.toml | 2 +- ff/Cargo.toml | 9 ++++++--- ff/README.md | 4 ++-- ff/ff_derive/Cargo.toml | 2 +- group/Cargo.toml | 2 +- jubjub/Cargo.toml | 2 +- pairing/Cargo.toml | 2 +- zcash_client_backend/Cargo.toml | 2 +- zcash_client_sqlite/Cargo.toml | 2 +- zcash_primitives/Cargo.toml | 2 +- zcash_proofs/Cargo.toml | 2 +- 12 files changed, 18 insertions(+), 15 deletions(-) diff --git a/bellman/Cargo.toml b/bellman/Cargo.toml index 45fd968ff7..bfddabf3c2 100644 --- a/bellman/Cargo.toml +++ b/bellman/Cargo.toml @@ -12,7 +12,7 @@ edition = "2018" [dependencies] bit-vec = "0.6" blake2s_simd = "0.5" -ff = { version = "0.6", path = "../ff" } +ff = { version = "0.7", path = "../ff" } futures = "0.1" futures-cpupool = { version = "0.1", optional = true } group = { version = "0.6", path = "../group" } diff --git a/bls12_381/Cargo.toml b/bls12_381/Cargo.toml index 1799294f29..8fa1850c9b 100644 --- a/bls12_381/Cargo.toml +++ b/bls12_381/Cargo.toml @@ -26,7 +26,7 @@ default-features = false [dependencies.ff] path = "../ff" -version = "0.6" +version = "0.7" default-features = false [dependencies.group] diff --git a/ff/Cargo.toml b/ff/Cargo.toml index 01cc6c6513..e081e84c12 100644 --- a/ff/Cargo.toml +++ b/ff/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "ff" -version = "0.6.0" -authors = ["Sean Bowe "] +version = "0.7.0" +authors = [ + "Sean Bowe ", + "Jack Grigg ", +] description = "Library for building and interfacing with finite fields" readme = "README.md" documentation = "https://docs.rs/ff/" @@ -12,7 +15,7 @@ edition = "2018" [dependencies] byteorder = { version = "1", default-features = false } -ff_derive = { version = "0.6", path = "ff_derive", optional = true } +ff_derive = { version = "0.7", path = "ff_derive", optional = true } rand_core = { version = "0.5", default-features = false } subtle = { version = "2.2.1", default-features = false, features = ["i128"] } diff --git a/ff/README.md b/ff/README.md index 57ef693f35..4fbe19028b 100644 --- a/ff/README.md +++ b/ff/README.md @@ -12,7 +12,7 @@ Add the `ff` crate to your `Cargo.toml`: ```toml [dependencies] -ff = "0.5" +ff = "0.7" ``` The `ff` crate contains `Field`, `PrimeField`, `PrimeFieldRepr` and `SqrtField` traits. @@ -29,7 +29,7 @@ First, enable the `derive` crate feature: ```toml [dependencies] -ff = { version = "0.4", features = ["derive"] } +ff = { version = "0.7", features = ["derive"] } ``` And then use the macro like so: diff --git a/ff/ff_derive/Cargo.toml b/ff/ff_derive/Cargo.toml index 89a45b315e..e1e26bc563 100644 --- a/ff/ff_derive/Cargo.toml +++ b/ff/ff_derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ff_derive" -version = "0.6.0" +version = "0.7.0" authors = [ "Sean Bowe ", "Jack Grigg ", diff --git a/group/Cargo.toml b/group/Cargo.toml index ec5dff86a6..40b851eb64 100644 --- a/group/Cargo.toml +++ b/group/Cargo.toml @@ -16,7 +16,7 @@ edition = "2018" [dependencies] byteorder = { version = "1", default-features = false } -ff = { version = "0.6", path = "../ff" } +ff = { version = "0.7", path = "../ff" } rand = "0.7" rand_xorshift = "0.2" subtle = { version = "2.2.1", default-features = false } diff --git a/jubjub/Cargo.toml b/jubjub/Cargo.toml index 5955e6cb73..f7a5c59048 100644 --- a/jubjub/Cargo.toml +++ b/jubjub/Cargo.toml @@ -24,7 +24,7 @@ default-features = false [dependencies.ff] path = "../ff" -version = "0.6" +version = "0.7" default-features = false [dependencies.group] diff --git a/pairing/Cargo.toml b/pairing/Cargo.toml index d24e2d0ed0..4686ca2e65 100644 --- a/pairing/Cargo.toml +++ b/pairing/Cargo.toml @@ -18,7 +18,7 @@ edition ="2018" [dependencies] byteorder = "1" -ff = { version = "0.6", path = "../ff", features = ["derive"] } +ff = { version = "0.7", path = "../ff", features = ["derive"] } group = { version = "0.6", path = "../group" } rand_core = "0.5" subtle = "2.2.1" diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index 8ceeb6e53b..942aabe5ca 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" bech32 = "0.7" bls12_381 = { version = "0.1", path = "../bls12_381" } bs58 = { version = "0.3", features = ["check"] } -ff = { version = "0.6", path = "../ff" } +ff = { version = "0.7", path = "../ff" } group = { version = "0.6", path = "../group" } hex = "0.4" jubjub = { version = "0.3", path = "../jubjub" } diff --git a/zcash_client_sqlite/Cargo.toml b/zcash_client_sqlite/Cargo.toml index 61467a426a..87e7bacca1 100644 --- a/zcash_client_sqlite/Cargo.toml +++ b/zcash_client_sqlite/Cargo.toml @@ -14,7 +14,7 @@ edition = "2018" [dependencies] bech32 = "0.7" bs58 = { version = "0.3", features = ["check"] } -ff = { version = "0.6", path = "../ff" } +ff = { version = "0.7", path = "../ff" } group = { version = "0.6", path = "../group" } jubjub = { version = "0.3", path = "../jubjub" } pairing = { version = "0.16", path = "../pairing" } diff --git a/zcash_primitives/Cargo.toml b/zcash_primitives/Cargo.toml index bef7f4edc1..f8b03933ac 100644 --- a/zcash_primitives/Cargo.toml +++ b/zcash_primitives/Cargo.toml @@ -22,7 +22,7 @@ bls12_381 = { version = "0.1", path = "../bls12_381" } byteorder = "1" crypto_api_chachapoly = "0.4" equihash = { version = "0.1", path = "../components/equihash" } -ff = { version = "0.6", path = "../ff" } +ff = { version = "0.7", path = "../ff" } fpe = "0.3" group = { version = "0.6", path = "../group" } hex = "0.4" diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index 74567b4600..7d851681bb 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -20,7 +20,7 @@ blake2b_simd = "0.5" bls12_381 = { version = "0.1", path = "../bls12_381" } byteorder = "1" directories = { version = "3", optional = true } -ff = { version = "0.6", path = "../ff" } +ff = { version = "0.7", path = "../ff" } group = { version = "0.6", path = "../group" } jubjub = { version = "0.3", path = "../jubjub" } lazy_static = "1" From ee3e8fbfbb4af6c249f026f6271935aa52301a30 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 11:33:31 +0100 Subject: [PATCH 02/10] group 0.7.0 --- bellman/Cargo.toml | 2 +- bls12_381/Cargo.toml | 2 +- group/Cargo.toml | 2 +- jubjub/Cargo.toml | 2 +- pairing/Cargo.toml | 2 +- zcash_client_backend/Cargo.toml | 2 +- zcash_client_sqlite/Cargo.toml | 2 +- zcash_primitives/Cargo.toml | 2 +- zcash_proofs/Cargo.toml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bellman/Cargo.toml b/bellman/Cargo.toml index bfddabf3c2..79843b39a2 100644 --- a/bellman/Cargo.toml +++ b/bellman/Cargo.toml @@ -15,7 +15,7 @@ blake2s_simd = "0.5" ff = { version = "0.7", path = "../ff" } futures = "0.1" futures-cpupool = { version = "0.1", optional = true } -group = { version = "0.6", path = "../group" } +group = { version = "0.7", path = "../group" } num_cpus = { version = "1", optional = true } crossbeam = { version = "0.7", optional = true } pairing = { version = "0.16", path = "../pairing", optional = true } diff --git a/bls12_381/Cargo.toml b/bls12_381/Cargo.toml index 8fa1850c9b..92e65e2835 100644 --- a/bls12_381/Cargo.toml +++ b/bls12_381/Cargo.toml @@ -31,7 +31,7 @@ default-features = false [dependencies.group] path = "../group" -version = "0.6" +version = "0.7" default-features = false optional = true diff --git a/group/Cargo.toml b/group/Cargo.toml index 40b851eb64..57ad76f81d 100644 --- a/group/Cargo.toml +++ b/group/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "group" -version = "0.6.0" +version = "0.7.0" authors = [ "Sean Bowe ", "Jack Grigg ", diff --git a/jubjub/Cargo.toml b/jubjub/Cargo.toml index f7a5c59048..5fdd35ef04 100644 --- a/jubjub/Cargo.toml +++ b/jubjub/Cargo.toml @@ -29,7 +29,7 @@ default-features = false [dependencies.group] path = "../group" -version = "0.6" +version = "0.7" default-features = false [dependencies.rand_core] diff --git a/pairing/Cargo.toml b/pairing/Cargo.toml index 4686ca2e65..2805c0d605 100644 --- a/pairing/Cargo.toml +++ b/pairing/Cargo.toml @@ -19,7 +19,7 @@ edition ="2018" [dependencies] byteorder = "1" ff = { version = "0.7", path = "../ff", features = ["derive"] } -group = { version = "0.6", path = "../group" } +group = { version = "0.7", path = "../group" } rand_core = "0.5" subtle = "2.2.1" diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index 942aabe5ca..960da2f045 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -16,7 +16,7 @@ bech32 = "0.7" bls12_381 = { version = "0.1", path = "../bls12_381" } bs58 = { version = "0.3", features = ["check"] } ff = { version = "0.7", path = "../ff" } -group = { version = "0.6", path = "../group" } +group = { version = "0.7", path = "../group" } hex = "0.4" jubjub = { version = "0.3", path = "../jubjub" } pairing = { version = "0.16", path = "../pairing" } diff --git a/zcash_client_sqlite/Cargo.toml b/zcash_client_sqlite/Cargo.toml index 87e7bacca1..bdd79bc6a2 100644 --- a/zcash_client_sqlite/Cargo.toml +++ b/zcash_client_sqlite/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" bech32 = "0.7" bs58 = { version = "0.3", features = ["check"] } ff = { version = "0.7", path = "../ff" } -group = { version = "0.6", path = "../group" } +group = { version = "0.7", path = "../group" } jubjub = { version = "0.3", path = "../jubjub" } pairing = { version = "0.16", path = "../pairing" } protobuf = "2" diff --git a/zcash_primitives/Cargo.toml b/zcash_primitives/Cargo.toml index f8b03933ac..6206a3902c 100644 --- a/zcash_primitives/Cargo.toml +++ b/zcash_primitives/Cargo.toml @@ -24,7 +24,7 @@ crypto_api_chachapoly = "0.4" equihash = { version = "0.1", path = "../components/equihash" } ff = { version = "0.7", path = "../ff" } fpe = "0.3" -group = { version = "0.6", path = "../group" } +group = { version = "0.7", path = "../group" } hex = "0.4" jubjub = { version = "0.3", path = "../jubjub" } lazy_static = "1" diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index 7d851681bb..2b7bac2d3d 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -21,7 +21,7 @@ bls12_381 = { version = "0.1", path = "../bls12_381" } byteorder = "1" directories = { version = "3", optional = true } ff = { version = "0.7", path = "../ff" } -group = { version = "0.6", path = "../group" } +group = { version = "0.7", path = "../group" } jubjub = { version = "0.3", path = "../jubjub" } lazy_static = "1" minreq = { version = "2", features = ["https"], optional = true } From bdb42bcbc8f2a4e8d9a8b918d9085574552e98ef Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 11:40:10 +0100 Subject: [PATCH 03/10] pairing 0.17.0 --- bellman/Cargo.toml | 2 +- bls12_381/Cargo.toml | 2 +- pairing/Cargo.toml | 2 +- pairing/README.md | 11 +++-------- zcash_client_backend/Cargo.toml | 1 - zcash_client_sqlite/Cargo.toml | 1 - zcash_primitives/Cargo.toml | 1 - zcash_primitives/src/note_encryption.rs | 1 - zcash_proofs/Cargo.toml | 1 - 9 files changed, 6 insertions(+), 16 deletions(-) diff --git a/bellman/Cargo.toml b/bellman/Cargo.toml index 79843b39a2..f6abb911f1 100644 --- a/bellman/Cargo.toml +++ b/bellman/Cargo.toml @@ -18,7 +18,7 @@ futures-cpupool = { version = "0.1", optional = true } group = { version = "0.7", path = "../group" } num_cpus = { version = "1", optional = true } crossbeam = { version = "0.7", optional = true } -pairing = { version = "0.16", path = "../pairing", optional = true } +pairing = { version = "0.17", path = "../pairing", optional = true } rand_core = "0.5" byteorder = "1" subtle = "2.2.1" diff --git a/bls12_381/Cargo.toml b/bls12_381/Cargo.toml index 92e65e2835..585713424b 100644 --- a/bls12_381/Cargo.toml +++ b/bls12_381/Cargo.toml @@ -37,7 +37,7 @@ optional = true [dependencies.pairing] path = "../pairing" -version = "0.16" +version = "0.17" optional = true [dependencies.rand_core] diff --git a/pairing/Cargo.toml b/pairing/Cargo.toml index 2805c0d605..5993a58874 100644 --- a/pairing/Cargo.toml +++ b/pairing/Cargo.toml @@ -2,7 +2,7 @@ name = "pairing" # Remember to change version string in README.md. -version = "0.16.0" +version = "0.17.0" authors = [ "Sean Bowe ", "Jack Grigg ", diff --git a/pairing/README.md b/pairing/README.md index 47a25dc686..e46fc58c3f 100644 --- a/pairing/README.md +++ b/pairing/README.md @@ -2,15 +2,10 @@ `pairing` is a crate for using pairing-friendly elliptic curves. -Currently, only the [BLS12-381](https://z.cash/blog/new-snark-curve.html) -construction is implemented. +`pairing` provides basic traits for pairing-friendly elliptic curve constructions. +Specific curves are implemented in separate crates: -## Roadmap - -`pairing` is being refactored into a generic library for working with -pairing-friendly curves. After the refactor, `pairing` will provide basic traits -for pairing-friendly elliptic curve constructions, while specific curves will be -in separate crates. +- [`bls12_381`](https://crates.io/crates/bls12_381) - the BLS12-381 curve. ## [Documentation](https://docs.rs/pairing/) diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index 960da2f045..3163d83e8e 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -19,7 +19,6 @@ ff = { version = "0.7", path = "../ff" } group = { version = "0.7", path = "../group" } hex = "0.4" jubjub = { version = "0.3", path = "../jubjub" } -pairing = { version = "0.16", path = "../pairing" } protobuf = "=2.14.0" # 2.15 has MSRV of 1.44.1 subtle = "2" zcash_primitives = { version = "0.2", path = "../zcash_primitives" } diff --git a/zcash_client_sqlite/Cargo.toml b/zcash_client_sqlite/Cargo.toml index bdd79bc6a2..0f1a6a84bf 100644 --- a/zcash_client_sqlite/Cargo.toml +++ b/zcash_client_sqlite/Cargo.toml @@ -17,7 +17,6 @@ bs58 = { version = "0.3", features = ["check"] } ff = { version = "0.7", path = "../ff" } group = { version = "0.7", path = "../group" } jubjub = { version = "0.3", path = "../jubjub" } -pairing = { version = "0.16", path = "../pairing" } protobuf = "2" rand_core = "0.5.1" rusqlite = { version = "0.23", features = ["bundled"] } diff --git a/zcash_primitives/Cargo.toml b/zcash_primitives/Cargo.toml index 6206a3902c..6973ccae34 100644 --- a/zcash_primitives/Cargo.toml +++ b/zcash_primitives/Cargo.toml @@ -29,7 +29,6 @@ hex = "0.4" jubjub = { version = "0.3", path = "../jubjub" } lazy_static = "1" log = "0.4" -pairing = { version = "0.16", path = "../pairing" } rand = "0.7" rand_core = "0.5.1" ripemd160 = { version = "0.9", optional = true } diff --git a/zcash_primitives/src/note_encryption.rs b/zcash_primitives/src/note_encryption.rs index 6e120fe84a..292724d1f9 100644 --- a/zcash_primitives/src/note_encryption.rs +++ b/zcash_primitives/src/note_encryption.rs @@ -185,7 +185,6 @@ pub fn prf_ock( /// /// ``` /// extern crate ff; -/// extern crate pairing; /// extern crate rand_core; /// extern crate zcash_primitives; /// diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index 2b7bac2d3d..8f7ee8dda8 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -25,7 +25,6 @@ group = { version = "0.7", path = "../group" } jubjub = { version = "0.3", path = "../jubjub" } lazy_static = "1" minreq = { version = "2", features = ["https"], optional = true } -pairing = { version = "0.16", path = "../pairing" } rand_core = "0.5.1" wagyu-zcash-parameters = { version = "0.2", optional = true } zcash_primitives = { version = "0.2", path = "../zcash_primitives" } From 5f99c52143c07857d22978622880fdfca91de435 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 11:46:27 +0100 Subject: [PATCH 04/10] bls12_381 0.2.0 --- bellman/Cargo.toml | 2 +- bls12_381/Cargo.toml | 7 +++++-- bls12_381/RELEASES.md | 32 ++++++++++++++++++++++++++++++++ jubjub/Cargo.toml | 2 +- zcash_client_backend/Cargo.toml | 2 +- zcash_primitives/Cargo.toml | 2 +- zcash_proofs/Cargo.toml | 2 +- 7 files changed, 42 insertions(+), 7 deletions(-) diff --git a/bellman/Cargo.toml b/bellman/Cargo.toml index f6abb911f1..81ec8cdd31 100644 --- a/bellman/Cargo.toml +++ b/bellman/Cargo.toml @@ -24,7 +24,7 @@ byteorder = "1" subtle = "2.2.1" [dev-dependencies] -bls12_381 = { version = "0.1", path = "../bls12_381" } +bls12_381 = { version = "0.2", path = "../bls12_381" } hex-literal = "0.2" rand = "0.7" rand_xorshift = "0.2" diff --git a/bls12_381/Cargo.toml b/bls12_381/Cargo.toml index 585713424b..4411401425 100644 --- a/bls12_381/Cargo.toml +++ b/bls12_381/Cargo.toml @@ -1,12 +1,15 @@ [package] -authors = ["Sean Bowe "] +authors = [ + "Sean Bowe ", + "Jack Grigg ", +] description = "Implementation of the BLS12-381 pairing-friendly elliptic curve construction" documentation = "https://docs.rs/bls12_381/" homepage = "https://github.com/zkcrypto/bls12_381" license = "MIT/Apache-2.0" name = "bls12_381" repository = "https://github.com/zkcrypto/bls12_381" -version = "0.1.1" +version = "0.2.0" edition = "2018" [package.metadata.docs.rs] diff --git a/bls12_381/RELEASES.md b/bls12_381/RELEASES.md index 85fcd4ae5a..5f314c4379 100644 --- a/bls12_381/RELEASES.md +++ b/bls12_381/RELEASES.md @@ -1,3 +1,35 @@ +# 0.2.0 + +This release adds implementations of the `ff`, `group`, and `pairing` traits (with the +latter two being gated by the `groups` and `pairings` feature flags respectively). +Additional trait implementations (for standard traits) have been added where the `ff`, +`group`, and `pairing` trait bounds require them. + +## Added +* `bls12_381::Bls12`, a `pairing::Engine` for BLS12-381 pairing operations. It implements + the following traits: + * `pairing::{Engine, MultiMillerLoop}` +* New trait implementations for `bls12_381::G1Projective`: + * `group::{Curve, Group, GroupEncoding, WnafGroup}` + * `group::prime::{PrimeCurve, PrimeGroup}` +* New trait implementations for `bls12_381::G1Affine`: + * `group::{GroupEncoding, UncompressedEncoding}` + * `group::prime::PrimeCurveAffine` + * `pairing::PairingCurveAffine` +* New trait implementations for `bls12_381::G2Projective`: + * `group::{Curve, Group, GroupEncoding, WnafGroup}` + * `group::prime::{PrimeCurve, PrimeGroup}` +* New trait implementations for `bls12_381::G2Affine`: + * `group::{GroupEncoding, UncompressedEncoding}` + * `group::prime::PrimeCurveAffine` + * `pairing::PairingCurveAffine` +* New trait implementations for `bls12_381::Gt`: + * `group::Group` +* New trait implementations for `bls12_381::MillerLoopResult`: + * `pairing::MillerLoopResult` +* New trait implementations for `bls12_381::Scalar`: + * `ff::{Field, PrimeField}` + # 0.1.1 Added `clear_cofactor` methods to `G1Projective` and `G2Projective`. If the crate feature `endo` diff --git a/jubjub/Cargo.toml b/jubjub/Cargo.toml index 5fdd35ef04..af07bfd9a7 100644 --- a/jubjub/Cargo.toml +++ b/jubjub/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" [dependencies.bls12_381] path = "../bls12_381" -version = "0.1" +version = "0.2" default-features = false [dependencies.byteorder] diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index 3163d83e8e..c5de72508e 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" [dependencies] bech32 = "0.7" -bls12_381 = { version = "0.1", path = "../bls12_381" } +bls12_381 = { version = "0.2", path = "../bls12_381" } bs58 = { version = "0.3", features = ["check"] } ff = { version = "0.7", path = "../ff" } group = { version = "0.7", path = "../group" } diff --git a/zcash_primitives/Cargo.toml b/zcash_primitives/Cargo.toml index 6973ccae34..c18a95628e 100644 --- a/zcash_primitives/Cargo.toml +++ b/zcash_primitives/Cargo.toml @@ -18,7 +18,7 @@ all-features = true aes = "0.5" blake2b_simd = "0.5" blake2s_simd = "0.5" -bls12_381 = { version = "0.1", path = "../bls12_381" } +bls12_381 = { version = "0.2", path = "../bls12_381" } byteorder = "1" crypto_api_chachapoly = "0.4" equihash = { version = "0.1", path = "../components/equihash" } diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index 8f7ee8dda8..ae297dbbce 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -17,7 +17,7 @@ all-features = true [dependencies] bellman = { version = "0.6", path = "../bellman", default-features = false, features = ["groth16"] } blake2b_simd = "0.5" -bls12_381 = { version = "0.1", path = "../bls12_381" } +bls12_381 = { version = "0.2", path = "../bls12_381" } byteorder = "1" directories = { version = "3", optional = true } ff = { version = "0.7", path = "../ff" } From d112add8a3fa9bce4a130777be682259d895062c Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 11:48:19 +0100 Subject: [PATCH 05/10] jubjub 0.4.0 --- jubjub/Cargo.toml | 6 +----- jubjub/RELEASES.md | 29 +++++++++++++++++++++++++++++ zcash_client_backend/Cargo.toml | 2 +- zcash_client_sqlite/Cargo.toml | 2 +- zcash_primitives/Cargo.toml | 2 +- zcash_proofs/Cargo.toml | 2 +- 6 files changed, 34 insertions(+), 9 deletions(-) diff --git a/jubjub/Cargo.toml b/jubjub/Cargo.toml index af07bfd9a7..3f9485ca95 100644 --- a/jubjub/Cargo.toml +++ b/jubjub/Cargo.toml @@ -10,7 +10,7 @@ homepage = "https://github.com/zkcrypto/jubjub" license = "MIT/Apache-2.0" name = "jubjub" repository = "https://github.com/zkcrypto/jubjub" -version = "0.3.0" +version = "0.4.0" edition = "2018" [dependencies.bls12_381] @@ -43,10 +43,6 @@ default-features = false [dev-dependencies] criterion = "0.3" -[dev-dependencies.rand_core] -version = "0.5" -default-features = false - [dev-dependencies.rand_xorshift] version = "0.2" default-features = false diff --git a/jubjub/RELEASES.md b/jubjub/RELEASES.md index 45db61c1ff..b9a1e9efff 100644 --- a/jubjub/RELEASES.md +++ b/jubjub/RELEASES.md @@ -1,3 +1,32 @@ +# 0.4.0 + +This release adds implementations of the `ff` and `group` traits. Additional trait +implementations (for standard traits) have been added where the `ff` and `group` trait +bounds require them. + +## Added +* `jubjub::SubgroupPoint`, which represents an element of Jubjub's prime-order subgroup. + It implements the following traits: + * `group::{Group, GroupEncoding}` + * `group::prime::PrimeGroup` +* New trait implementations for `jubjub::ExtendedPoint`: + * `group::{Curve, Group, GroupEncoding, WnafGroup}` + * `group::cofactor::{CofactorCurve, CofactorGroup}` +* New trait implementations for `jubjub::AffinePoint`: + * `group::GroupEncoding` + * `group::cofactor::CofactorCurveAffine` +* New trait implementations for `jubjub::Fr`: + * `ff::{Field, PrimeField}` +* `jubjub::AffinePoint::is_identity` +* `jubjub::AffinePoint::to_extended` +* `jubjub::Scalar`, as an alias for `jubjub::Fr`. + +## Changed +* We've migrated to `bls12_381 0.2`. +* `rand_core` is now a regular dependency. +* We depend on the `byteorder` crate again, as it is part of the `ff::PrimeField` trait. +* The benchmarks are now implemented using `criterion`. + # 0.3.0 This release now depends on the `bls12_381` crate, which exposes the `Fq` field type that we re-export. diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index c5de72508e..620f29eac6 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -18,7 +18,7 @@ bs58 = { version = "0.3", features = ["check"] } ff = { version = "0.7", path = "../ff" } group = { version = "0.7", path = "../group" } hex = "0.4" -jubjub = { version = "0.3", path = "../jubjub" } +jubjub = { version = "0.4", path = "../jubjub" } protobuf = "=2.14.0" # 2.15 has MSRV of 1.44.1 subtle = "2" zcash_primitives = { version = "0.2", path = "../zcash_primitives" } diff --git a/zcash_client_sqlite/Cargo.toml b/zcash_client_sqlite/Cargo.toml index 0f1a6a84bf..efdfac8592 100644 --- a/zcash_client_sqlite/Cargo.toml +++ b/zcash_client_sqlite/Cargo.toml @@ -16,7 +16,7 @@ bech32 = "0.7" bs58 = { version = "0.3", features = ["check"] } ff = { version = "0.7", path = "../ff" } group = { version = "0.7", path = "../group" } -jubjub = { version = "0.3", path = "../jubjub" } +jubjub = { version = "0.4", path = "../jubjub" } protobuf = "2" rand_core = "0.5.1" rusqlite = { version = "0.23", features = ["bundled"] } diff --git a/zcash_primitives/Cargo.toml b/zcash_primitives/Cargo.toml index c18a95628e..e1f6692ac6 100644 --- a/zcash_primitives/Cargo.toml +++ b/zcash_primitives/Cargo.toml @@ -26,7 +26,7 @@ ff = { version = "0.7", path = "../ff" } fpe = "0.3" group = { version = "0.7", path = "../group" } hex = "0.4" -jubjub = { version = "0.3", path = "../jubjub" } +jubjub = { version = "0.4", path = "../jubjub" } lazy_static = "1" log = "0.4" rand = "0.7" diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index ae297dbbce..472d8d1532 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -22,7 +22,7 @@ byteorder = "1" directories = { version = "3", optional = true } ff = { version = "0.7", path = "../ff" } group = { version = "0.7", path = "../group" } -jubjub = { version = "0.3", path = "../jubjub" } +jubjub = { version = "0.4", path = "../jubjub" } lazy_static = "1" minreq = { version = "2", features = ["https"], optional = true } rand_core = "0.5.1" From 1124eb3ca9ad70df5e6dd201073c7a05da1e8e61 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 11:57:27 +0100 Subject: [PATCH 06/10] bellman 0.7.0 --- bellman/Cargo.toml | 2 +- bellman/README.md | 13 ++++++++----- zcash_proofs/Cargo.toml | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bellman/Cargo.toml b/bellman/Cargo.toml index 81ec8cdd31..a6f02b3a40 100644 --- a/bellman/Cargo.toml +++ b/bellman/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://github.com/ebfull/bellman" license = "MIT/Apache-2.0" name = "bellman" repository = "https://github.com/ebfull/bellman" -version = "0.6.0" +version = "0.7.0" edition = "2018" [dependencies] diff --git a/bellman/README.md b/bellman/README.md index d64dd9c1e4..850f2e3e67 100644 --- a/bellman/README.md +++ b/bellman/README.md @@ -4,13 +4,16 @@ and primitive structures, as well as basic gadget implementations such as booleans and number abstractions. +`bellman` uses the `ff` and `group` crates to build circuits generically over a +scalar field type, which is used as the "word" of a circuit. Arithmetic +operations modulo the scalar field's prime are efficient, while other operations +(such as boolean logic) are implemented using these words. + ## Roadmap -`bellman` is being refactored into a generic proving library. Currently it is -pairing-specific, and different types of proving systems need to be implemented -as sub-modules. After the refactor, `bellman` will be generic using the `ff` and -`group` crates, while specific proving systems will be separate crates that pull -in the dependencies they require. +Currently `bellman` bundles an implementation of the Groth16 proving system. +This will be moved into a separate crate in the future, and `bellman` will +contain any utilities that make implementing proving systems easier. ## License diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index 472d8d1532..6e4f7773d0 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" all-features = true [dependencies] -bellman = { version = "0.6", path = "../bellman", default-features = false, features = ["groth16"] } +bellman = { version = "0.7", path = "../bellman", default-features = false, features = ["groth16"] } blake2b_simd = "0.5" bls12_381 = { version = "0.2", path = "../bls12_381" } byteorder = "1" From e25a7dacdf86cd873a56f0b89c20d62b5fec50d1 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 12:06:21 +0100 Subject: [PATCH 07/10] zcash_primitives 0.3.0 --- zcash_client_backend/Cargo.toml | 2 +- zcash_client_sqlite/Cargo.toml | 2 +- zcash_primitives/Cargo.toml | 2 +- zcash_proofs/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index 620f29eac6..49b4b8bfa2 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -21,7 +21,7 @@ hex = "0.4" jubjub = { version = "0.4", path = "../jubjub" } protobuf = "=2.14.0" # 2.15 has MSRV of 1.44.1 subtle = "2" -zcash_primitives = { version = "0.2", path = "../zcash_primitives" } +zcash_primitives = { version = "0.3", path = "../zcash_primitives" } [build-dependencies] protobuf-codegen-pure = "2.14" diff --git a/zcash_client_sqlite/Cargo.toml b/zcash_client_sqlite/Cargo.toml index efdfac8592..e1ed3357d7 100644 --- a/zcash_client_sqlite/Cargo.toml +++ b/zcash_client_sqlite/Cargo.toml @@ -22,7 +22,7 @@ rand_core = "0.5.1" rusqlite = { version = "0.23", features = ["bundled"] } time = "0.1" zcash_client_backend = { version = "0.2", path = "../zcash_client_backend" } -zcash_primitives = { version = "0.2", path = "../zcash_primitives" } +zcash_primitives = { version = "0.3", path = "../zcash_primitives" } [dev-dependencies] rand_core = "0.5.1" diff --git a/zcash_primitives/Cargo.toml b/zcash_primitives/Cargo.toml index e1f6692ac6..c60d94f326 100644 --- a/zcash_primitives/Cargo.toml +++ b/zcash_primitives/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zcash_primitives" description = "Rust implementations of the Zcash primitives" -version = "0.2.0" +version = "0.3.0" authors = [ "Jack Grigg ", ] diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index 6e4f7773d0..ec3efe9140 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -27,7 +27,7 @@ lazy_static = "1" minreq = { version = "2", features = ["https"], optional = true } rand_core = "0.5.1" wagyu-zcash-parameters = { version = "0.2", optional = true } -zcash_primitives = { version = "0.2", path = "../zcash_primitives" } +zcash_primitives = { version = "0.3", path = "../zcash_primitives" } [dev-dependencies] rand_xorshift = "0.2" From 9ce0994f0b4f68eb73dfdc57d95178af6a54263f Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 12:07:02 +0100 Subject: [PATCH 08/10] zcash_proofs 0.3.0 --- zcash_client_sqlite/Cargo.toml | 2 +- zcash_proofs/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zcash_client_sqlite/Cargo.toml b/zcash_client_sqlite/Cargo.toml index e1ed3357d7..7af12a13b4 100644 --- a/zcash_client_sqlite/Cargo.toml +++ b/zcash_client_sqlite/Cargo.toml @@ -27,7 +27,7 @@ zcash_primitives = { version = "0.3", path = "../zcash_primitives" } [dev-dependencies] rand_core = "0.5.1" tempfile = "3" -zcash_proofs = { version = "0.2", path = "../zcash_proofs" } +zcash_proofs = { version = "0.3", path = "../zcash_proofs" } [features] mainnet = [] diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index ec3efe9140..6dc1bbdd90 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zcash_proofs" description = "Zcash zk-SNARK circuits and proving APIs" -version = "0.2.0" +version = "0.3.0" authors = [ "Jack Grigg ", ] From 0a3752c0880199528ddb20a8423b529b01b8c254 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 12:09:27 +0100 Subject: [PATCH 09/10] zcash_client_backend 0.3.0 --- zcash_client_backend/Cargo.toml | 2 +- zcash_client_sqlite/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index 49b4b8bfa2..140d6d57b7 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zcash_client_backend" description = "APIs for creating shielded Zcash light clients" -version = "0.2.0" +version = "0.3.0" authors = [ "Jack Grigg ", ] diff --git a/zcash_client_sqlite/Cargo.toml b/zcash_client_sqlite/Cargo.toml index 7af12a13b4..e6a0395796 100644 --- a/zcash_client_sqlite/Cargo.toml +++ b/zcash_client_sqlite/Cargo.toml @@ -21,7 +21,7 @@ protobuf = "2" rand_core = "0.5.1" rusqlite = { version = "0.23", features = ["bundled"] } time = "0.1" -zcash_client_backend = { version = "0.2", path = "../zcash_client_backend" } +zcash_client_backend = { version = "0.3", path = "../zcash_client_backend" } zcash_primitives = { version = "0.3", path = "../zcash_primitives" } [dev-dependencies] From 3cd8f64240609f517022ac0382fa7d4fc979f773 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 12:14:14 +0100 Subject: [PATCH 10/10] zcash_client_sqlite 0.1.0 --- zcash_client_sqlite/Cargo.toml | 2 +- zcash_client_sqlite/README.md | 37 +++++----------------------------- 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/zcash_client_sqlite/Cargo.toml b/zcash_client_sqlite/Cargo.toml index e6a0395796..32b5db3ca7 100644 --- a/zcash_client_sqlite/Cargo.toml +++ b/zcash_client_sqlite/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zcash_client_sqlite" description = "An SQLite-based Zcash light client" -version = "0.0.0" +version = "0.1.0" authors = [ "Jack Grigg ", ] diff --git a/zcash_client_sqlite/README.md b/zcash_client_sqlite/README.md index d73e3fe3b4..af077e8d59 100644 --- a/zcash_client_sqlite/README.md +++ b/zcash_client_sqlite/README.md @@ -1,39 +1,12 @@ # Security Disclaimer -#### :warning: WARNING: This is an *early preview* - ----- - -In the spirit of transparency, we provide this as a window into what we are actively -developing. This is an alpha build, not yet intended for 3rd party use. Please be advised +This is a beta build, and is currently under active development. Please be advised of the following: -* 🛑 This code currently is not audited. 🛑 -* ❌ This is a public, active branch with **no support**. -* ❌ The code **does not have** documentation that is reviewed and approved by our Documentation team. -* ❌ The code **does not have** adequate unit tests, acceptance tests and stress tests. -* ❌ The code **does not have** automated tests that use the officially supported CI system. -* ❌ The code **has not been subjected to thorough review** by engineers at the Electric Coin Company. -* :warning: This library **is** compatible with the latest version of zcashd, but there **is no** automated testing of this. -* :heavy_check_mark: The library **is not** majorly broken in some way. -* :heavy_check_mark: The library **does run** on mainnet and testnet. -* ❌ We **are actively rebasing** this branch and adding features where/when needed. -* ❌ We **do not** undertake appropriate security coverage (threat models, review, response, etc.). -* :heavy_check_mark: There is a product manager for this library. -* :heavy_check_mark: Electric Coin Company maintains the library as we discover bugs and do network upgrades/minor releases. -* :heavy_check_mark: Users can expect to get a response within a few weeks after submitting an issue. -* ❌ The User Support team **has not yet been briefed** on the features provided to users and the functionality of the associated test-framework. -* ❌ The code is **not fully-documented**. - - -### 🛑 Use of this code may lead to a loss of funds 🛑 - -Use of this code in its current form or with modifications may lead to loss of funds, loss -of "expected" privacy, or denial of service for a large portion of users, or a bug which -could leverage any of those kinds of attacks (especially a "0 day" where we suspect few -people know about the vulnerability). - -### :eyes: At this time, this is for preview purposes only. :eyes: +* This code currently is not audited by an external security auditor, use it at + your own risk. +* The code **has not been subjected to thorough review** by engineers at the Electric Coin Company. +* We **are actively changing** the codebase and adding features where/when needed. ----