diff --git a/bellman/Cargo.toml b/bellman/Cargo.toml index 45fd968ff7..a6f02b3a40 100644 --- a/bellman/Cargo.toml +++ b/bellman/Cargo.toml @@ -6,25 +6,25 @@ 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] 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" } +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" [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/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/bls12_381/Cargo.toml b/bls12_381/Cargo.toml index 1799294f29..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] @@ -26,18 +29,18 @@ default-features = false [dependencies.ff] path = "../ff" -version = "0.6" +version = "0.7" default-features = false [dependencies.group] path = "../group" -version = "0.6" +version = "0.7" default-features = false optional = true [dependencies.pairing] path = "../pairing" -version = "0.16" +version = "0.17" optional = true [dependencies.rand_core] 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/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..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 ", @@ -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..3f9485ca95 100644 --- a/jubjub/Cargo.toml +++ b/jubjub/Cargo.toml @@ -10,12 +10,12 @@ 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] path = "../bls12_381" -version = "0.1" +version = "0.2" default-features = false [dependencies.byteorder] @@ -24,12 +24,12 @@ default-features = false [dependencies.ff] path = "../ff" -version = "0.6" +version = "0.7" default-features = false [dependencies.group] path = "../group" -version = "0.6" +version = "0.7" default-features = false [dependencies.rand_core] @@ -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/pairing/Cargo.toml b/pairing/Cargo.toml index d24e2d0ed0..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 ", @@ -18,8 +18,8 @@ edition ="2018" [dependencies] byteorder = "1" -ff = { version = "0.6", path = "../ff", features = ["derive"] } -group = { version = "0.6", path = "../group" } +ff = { version = "0.7", path = "../ff", features = ["derive"] } +group = { version = "0.7", path = "../group" } rand_core = "0.5" subtle = "2.2.1" 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 8ceeb6e53b..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 ", ] @@ -13,16 +13,15 @@ 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.6", path = "../ff" } -group = { version = "0.6", path = "../group" } +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" } +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 61467a426a..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 ", ] @@ -14,21 +14,20 @@ edition = "2018" [dependencies] bech32 = "0.7" bs58 = { version = "0.3", features = ["check"] } -ff = { version = "0.6", path = "../ff" } -group = { version = "0.6", path = "../group" } -jubjub = { version = "0.3", path = "../jubjub" } -pairing = { version = "0.16", path = "../pairing" } +ff = { version = "0.7", path = "../ff" } +group = { version = "0.7", path = "../group" } +jubjub = { version = "0.4", path = "../jubjub" } 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_primitives = { version = "0.2", path = "../zcash_primitives" } +zcash_client_backend = { version = "0.3", path = "../zcash_client_backend" } +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_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. ---- diff --git a/zcash_primitives/Cargo.toml b/zcash_primitives/Cargo.toml index bef7f4edc1..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 ", ] @@ -18,18 +18,17 @@ 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" } -ff = { version = "0.6", path = "../ff" } +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" } +jubjub = { version = "0.4", 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 74567b4600..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 ", ] @@ -15,20 +15,19 @@ 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.1", path = "../bls12_381" } +bls12_381 = { version = "0.2", path = "../bls12_381" } byteorder = "1" directories = { version = "3", optional = true } -ff = { version = "0.6", path = "../ff" } -group = { version = "0.6", path = "../group" } -jubjub = { version = "0.3", path = "../jubjub" } +ff = { version = "0.7", path = "../ff" } +group = { version = "0.7", path = "../group" } +jubjub = { version = "0.4", 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" } +zcash_primitives = { version = "0.3", path = "../zcash_primitives" } [dev-dependencies] rand_xorshift = "0.2"