Merge pull request #29 from zcash/release-0.3.0

Release 0.3.0
This commit is contained in:
ebfull 2022-01-04 08:55:36 -07:00 committed by GitHub
commit de99732e20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 6 deletions

View file

@ -6,7 +6,14 @@ and this project adheres to Rust's notion of
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ## [Unreleased]
## [0.3.0] - 2022-01-03
### Added ### Added
- Support for `no-std` builds, via two new (default-enabled) feature flags:
- `alloc` enables the `pasta_curves::arithmetic::{CurveAffine, CurveExt}`
traits, as well as implementations of traits like `group::WnafGroup`.
- `sqrt-table` depends on `alloc`, and enables the large precomputed tables
(stored on the heap) that speed up square root computation.
- `pasta_curves::arithmetic::SqrtRatio` trait, extending `ff::PrimeField` with - `pasta_curves::arithmetic::SqrtRatio` trait, extending `ff::PrimeField` with
square roots of ratios. This trait is likely to be moved into the `ff` crate square roots of ratios. This trait is likely to be moved into the `ff` crate
in a future release (once we're satisfied with it). in a future release (once we're satisfied with it).

View file

@ -1,7 +1,7 @@
[package] [package]
name = "pasta_curves" name = "pasta_curves"
description = "Implementation of the Pallas and Vesta (Pasta) curve cycle" description = "Implementation of the Pallas and Vesta (Pasta) curve cycle"
version = "0.2.1" version = "0.3.0"
authors = [ authors = [
"Sean Bowe <sean@electriccoin.co>", "Sean Bowe <sean@electriccoin.co>",
"Ying Tong Lai <yingtong@electriccoin.co>", "Ying Tong Lai <yingtong@electriccoin.co>",
@ -41,18 +41,20 @@ harness = false
required-features = ["alloc"] required-features = ["alloc"]
[dependencies] [dependencies]
blake2b_simd = { version = "0.5", default-features = false }
ff = { version = "0.11", default-features = false } ff = { version = "0.11", default-features = false }
group = { version = "0.11", default-features = false } group = { version = "0.11", default-features = false }
rand = { version = "0.8", default-features = false } rand = { version = "0.8", default-features = false }
static_assertions = "1.1.0" static_assertions = "1.1.0"
subtle = { version = "2.3", default-features = false } subtle = { version = "2.3", default-features = false }
# std dependencies # alloc dependencies
blake2b_simd = { version = "1", optional = true, default-features = false }
# sqrt-table dependencies
lazy_static = { version = "1.4.0", optional = true } lazy_static = { version = "1.4.0", optional = true }
[features] [features]
default = ["bits", "sqrt-table"] default = ["bits", "sqrt-table"]
alloc = ["group/alloc"] alloc = ["group/alloc", "blake2b_simd"]
bits = ["ff/bits"] bits = ["ff/bits"]
sqrt-table = ["alloc", "lazy_static"] sqrt-table = ["alloc", "lazy_static"]

View file

@ -474,7 +474,12 @@ macro_rules! new_curve_impl {
// multiplication, moving from most significant to least // multiplication, moving from most significant to least
// significant bit of the scalar. // significant bit of the scalar.
// //
// NOTE: We skip the leading bit because it's always unset. // We don't use `PrimeFieldBits::.to_le_bits` here, because that would
// force users of this crate to depend on `bitvec` where they otherwise
// might not need to.
//
// NOTE: We skip the leading bit because it's always unset (we are turning
// the 32-byte repr into 256 bits, and $scalar::NUM_BITS = 255).
for bit in other for bit in other
.to_repr() .to_repr()
.iter() .iter()
@ -585,7 +590,12 @@ macro_rules! new_curve_impl {
// multiplication, moving from most significant to least // multiplication, moving from most significant to least
// significant bit of the scalar. // significant bit of the scalar.
// //
// NOTE: We skip the leading bit because it's always unset. // We don't use `PrimeFieldBits::.to_le_bits` here, because that would
// force users of this crate to depend on `bitvec` where they otherwise
// might not need to.
//
// NOTE: We skip the leading bit because it's always unset (we are turning
// the 32-byte repr into 256 bits, and $scalar::NUM_BITS = 255).
for bit in other for bit in other
.to_repr() .to_repr()
.iter() .iter()