From 6ffc8ddefd84a74dd1b0b1844288e322b3127dfc Mon Sep 17 00:00:00 2001 From: Markus Zoppelt Date: Wed, 30 Sep 2020 12:59:10 +0200 Subject: [PATCH 01/25] bumped packed_simd to 0.3.4. resolves #333 (cherry picked from commit c2e394dd045e27ea4f26585d1b57e9b780aee6b8) Signed-off-by: Isis Lovecruft --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d73a932..bd5a157 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ byteorder = { version = "^1.2.3", default-features = false, features = ["i128"] digest = { version = "0.8", default-features = false } subtle = { version = "^2.2.1", default-features = false } serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] } -packed_simd = { version = "0.3", features = ["into_bits"], optional = true } +packed_simd = { package = "packed_simd_2", version = "*", git = "https://github.com/rust-lang/packed_simd", features = ["into_bits"], optional = true } zeroize = { version = "1", default-features = false } [features] From dd71df6ea03b04bcf3de09f72347b78b258e630c Mon Sep 17 00:00:00 2001 From: Markus Zoppelt Date: Wed, 30 Sep 2020 15:17:18 +0200 Subject: [PATCH 02/25] adjusted dependency entry like to pick up latest pick up the latest packed_simd crate under an alternative name. see also: https://github.com/rust-lang/packed_simd/issues/303#issuecomment-701361161 (cherry picked from commit f27923bf8c1cf696063f92aee06217c3fd861ea1) Signed-off-by: Isis Lovecruft --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bd5a157..d7c09ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ byteorder = { version = "^1.2.3", default-features = false, features = ["i128"] digest = { version = "0.8", default-features = false } subtle = { version = "^2.2.1", default-features = false } serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] } -packed_simd = { package = "packed_simd_2", version = "*", git = "https://github.com/rust-lang/packed_simd", features = ["into_bits"], optional = true } +packed_simd = { version = "0.3.4", package = "packed_simd_2", features = ["into_bits"], optional = true } zeroize = { version = "1", default-features = false } [features] From e6d8afc352b6547bccd51c51e717432add564bd9 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Wed, 30 Sep 2020 12:01:43 -0700 Subject: [PATCH 03/25] Add link to Cargo.toml with explanation of packed_simd renaming (cherry picked from commit 45f3f53351102ba8c7a8b062b4306fe93b7d169a) Signed-off-by: Isis Lovecruft --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index d7c09ba..ae34e6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,6 +45,8 @@ byteorder = { version = "^1.2.3", default-features = false, features = ["i128"] digest = { version = "0.8", default-features = false } subtle = { version = "^2.2.1", default-features = false } serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] } +# The original packed_simd package was orphaned, see +# https://github.com/rust-lang/packed_simd/issues/303#issuecomment-701361161 packed_simd = { version = "0.3.4", package = "packed_simd_2", features = ["into_bits"], optional = true } zeroize = { version = "1", default-features = false } From d00d4a5a9ad3aecea0d0c5dbab671e6cbc1d7412 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 7 Jan 2021 21:31:57 +0000 Subject: [PATCH 04/25] Fix CHANGELOG so that we can note backported patches. (cherry picked from commit 64099e9adfb2a8749910bd7fdc98aada112b7f91) Signed-off-by: Isis Lovecruft --- CHANGELOG.md | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a84de2c..d1828e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,15 @@ # Changelog -Entries are listed in reverse chronological order. +Entries are listed in reverse chronological order per undeprecated +major series. -## 2.1.0 +## 2.x series + +### 2.1.0 * Make `Scalar::from_bits` a `const fn`, allowing its use in `const` contexts. -## 2.0.0 +### 2.0.0 * Fix a data modeling error in the `serde` feature pointed out by Trevor Perrin which caused points and scalars to be serialized with length fields rather @@ -25,7 +28,15 @@ Entries are listed in reverse chronological order. The only significant change is the data model change to the `serde` feature; besides the `rand_core` version bump, there are no other user-visible changes. -## 1.2.3 +## 1.x series + +### 1.2.4 + +* Specify a semver bound for `clear_on_drop` rather than an exact version, + addressing an issue where changes to inline assembly in rustc prevented + `clear_on_drop` from working without an update. + +### 1.2.3 * Fix an issue identified by a Quarkslab audit (and Jack Grigg), where manually constructing unreduced `Scalar` values, as needed for X/Ed25519, and then @@ -39,14 +50,14 @@ besides the `rand_core` version bump, there are no other user-visible changes. * Fix compilation on nightly broken due to changes to the `#[doc(include)]` path root (not quite correctly done in 1.2.2). -## 1.2.2 +### 1.2.2 * Fix a typo in an internal doc-comment. * Add the "crypto" tag to crate metadata. * Fix compilation on nightly broken due to changes to the `#[doc(include)]` path root. -## 1.2.1 +### 1.2.1 * Fix a bug in bucket index calculations in the Pippenger multiscalar algorithm for very large input sizes. @@ -55,7 +66,7 @@ besides the `rand_core` version bump, there are no other user-visible changes. * Ensure that that multiscalar and NAF computations work correctly on extremal `Scalar` values constructed via `from_bits`. -## 1.2.0 +### 1.2.0 * New multiscalar multiplication algorithm with better performance for large problem sizes. The backend algorithm is selected @@ -64,16 +75,16 @@ besides the `rand_core` version bump, there are no other user-visible changes. * Equality of Edwards points is now checked in projective coordinates. * Serde can now be used with `no_std`. -## 1.1.4 +### 1.1.4 * Fix typos in documentation comments. * Remove unnecessary `Default` bound on `Scalar::from_hash`. -## 1.1.3 +### 1.1.3 * Reverts the change in 1.1.0 to allow owned and borrowed RNGs, which caused a breakage due to a subtle interaction with ownership rules. (The `RngCore` change is retained). -## 1.1.2 +### 1.1.2 * Disabled KaTeX on `docs.rs` pending proper [support upstream](https://github.com/rust-lang/docs.rs/issues/302). @@ -81,7 +92,7 @@ besides the `rand_core` version bump, there are no other user-visible changes. * Fixed an issue related to `#[cfg(rustdoc)]` which prevented documenting multiple backends. -## 1.1.0 +### 1.1.0 * Adds support for precomputation for multiscalar multiplication. * Restructures the internal source tree into `serial` and `vector` backends (no change to external API). @@ -90,19 +101,19 @@ besides the `rand_core` version bump, there are no other user-visible changes. * Replaces the `rand` dependency with `rand_core`. * Generalizes trait bounds on `RistrettoPoint::random()` and `Scalar::random()` to allow owned and borrowed RNGs and to allow `RngCore` instead of `Rng`. -## 1.0.3 +### 1.0.3 * Adds `ConstantTimeEq` implementation for compressed points. -## 1.0.2 +### 1.0.2 * Fixes a typo in the naming of variables in Ristretto formulas (no change to functionality). -## 1.0.1 +### 1.0.1 * Depends on the stable `2.0` version of `subtle` instead of `2.0.0-pre.0`. -## 1.0.0 +### 1.0.0 Initial stable release. Yanked due to a dependency mistake (see above). From bb889e478d6c90f60fb0b31d3b3c71f012575af9 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 7 Jan 2021 21:33:06 +0000 Subject: [PATCH 05/25] Remove deprecated feature flags from .travis.yml. (cherry picked from commit 7e320cd1d95bd9a1ea3c370e917ce0efcde63740) Signed-off-by: Isis Lovecruft --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc5f2dc..4b61db3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ env: - TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std u32_backend' # Tests the u64 backend - TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std u64_backend' - # Tests the avx2 backend - - TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std avx2_backend' + # Tests the simd backend + - TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std simd_backend' # Tests serde support and default feature selection - TEST_COMMAND=test EXTRA_FLAGS='' FEATURES='serde' # Tests building without std. We have to select a backend, so we select the one @@ -21,9 +21,9 @@ env: matrix: exclude: - # Test the avx2 backend only on nightly + # Test the simd backend only on nightly - rust: stable - env: TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std avx2_backend' + env: TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std simd_backend' # Test no_std+alloc only on nightly - rust: stable env: TEST_COMMAND=test EXTRA_FLAGS='--lib --no-default-features' FEATURES='alloc u32_backend' From 0f07443c2d6c915bcb44417cfd2ec03aa53f0539 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 7 Jan 2021 22:21:37 +0000 Subject: [PATCH 06/25] Bump curve25519-dalek to 2.1.1. --- CHANGELOG.md | 5 +++++ Cargo.toml | 2 +- src/lib.rs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1828e8..ffa081f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ major series. ## 2.x series +### 2.1.1 + +* Update the optional `packed-simd` dependency to rely on a newer, + maintained version of the `packed-simd-2` crate. + ### 2.1.0 * Make `Scalar::from_bits` a `const fn`, allowing its use in `const` contexts. diff --git a/Cargo.toml b/Cargo.toml index ae34e6a..c5be1f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ name = "curve25519-dalek" # - update CHANGELOG # - update html_root_url # - update README if required by semver -version = "2.1.0" +version = "2.1.1" authors = ["Isis Lovecruft ", "Henry de Valence "] readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index e1409a2..aecce3c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,7 +22,7 @@ #![cfg_attr(feature = "nightly", doc(include = "../README.md"))] #![doc(html_logo_url = "https://doc.dalek.rs/assets/dalek-logo-clear.png")] -#![doc(html_root_url = "https://docs.rs/curve25519-dalek/2.1.0")] +#![doc(html_root_url = "https://docs.rs/curve25519-dalek/2.1.1")] //! Note that docs will only build on nightly Rust until //! [RFC 1990 stabilizes](https://github.com/rust-lang/rust/issues/44732). From 4269b39f133aadd7da1c19a40cb4c2e0039f7a97 Mon Sep 17 00:00:00 2001 From: Stephane Raux Date: Tue, 20 Oct 2020 17:54:06 -0700 Subject: [PATCH 07/25] Make crate feature alloc work with stable Rust `println!` was removed in the test as the corresponding test for `u32` does not have it. (cherry picked from commit 608f8cd594433e26179fafd587a3b0138b4afcdb) Signed-off-by: Isis Lovecruft --- src/backend/serial/u64/scalar.rs | 1 - src/lib.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/src/backend/serial/u64/scalar.rs b/src/backend/serial/u64/scalar.rs index 97069ad..cee69da 100644 --- a/src/backend/serial/u64/scalar.rs +++ b/src/backend/serial/u64/scalar.rs @@ -443,7 +443,6 @@ mod test { fn from_bytes_wide() { let bignum = [255u8; 64]; // 2^512 - 1 let reduced = Scalar52::from_bytes_wide(&bignum); - println!("{:?}", reduced); for i in 0..5 { assert!(reduced[i] == C[i]); } diff --git a/src/lib.rs b/src/lib.rs index aecce3c..f8384b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,7 +10,6 @@ #![no_std] #![cfg_attr(feature = "nightly", feature(test))] -#![cfg_attr(all(feature = "alloc", not(feature = "std")), feature(alloc))] #![cfg_attr(feature = "nightly", feature(external_doc))] #![cfg_attr(feature = "nightly", feature(doc_cfg))] #![cfg_attr(feature = "simd_backend", feature(stdsimd))] From 3b79d0fbc43bf9a49d08fd7c326dd2041c12d9c4 Mon Sep 17 00:00:00 2001 From: root <287494524@qq.com> Date: Mon, 2 Sep 2019 11:26:11 +0800 Subject: [PATCH 08/25] errata for vpmuludq (cherry picked from commit fa849e014c0497ea4651473e80bf089c87468e32) Signed-off-by: Isis Lovecruft --- docs/avx2-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/avx2-notes.md b/docs/avx2-notes.md index 87992b3..ccb5022 100644 --- a/docs/avx2-notes.md +++ b/docs/avx2-notes.md @@ -12,7 +12,7 @@ representation (which uses radix \\(2^{51}\\)) amounts to regrouping digits. The field element representation is oriented around the AVX2 -`vpmuluqdq` instruction, which multiplies the low 32 bits of each +`vpmuludq` instruction, which multiplies the low 32 bits of each 64-bit lane of each operand to produce a 64-bit result. ```text,no_run From 87a5ed78b737a80d639cfb7bd6c72b9487477eba Mon Sep 17 00:00:00 2001 From: root <287494524@qq.com> Date: Tue, 3 Sep 2019 10:38:23 +0800 Subject: [PATCH 09/25] errata for comment (cherry picked from commit f6015c66c2493e0d50acf945430d9bf7accbbc83) Signed-off-by: Isis Lovecruft --- src/backend/vector/avx2/edwards.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/vector/avx2/edwards.rs b/src/backend/vector/avx2/edwards.rs index 8465720..8aadcc8 100644 --- a/src/backend/vector/avx2/edwards.rs +++ b/src/backend/vector/avx2/edwards.rs @@ -153,7 +153,7 @@ impl ExtendedPoint { // Set tmp1 = ( S_9, S_6, S_6, S_9) // b < ( 1.6, 1.6, 1.6, 1.6) tmp1 = tmp0.shuffle(Shuffle::DBBD); - // Set tmp1 = ( S_8, S_5, S_8, S_5) + // Set tmp0 = ( S_8, S_5, S_8, S_5) // b < (2.33, 1.01, 2.33, 1.01) tmp0 = tmp0.shuffle(Shuffle::CACA); From 4b268a9d7e10fa5f6f20515e7276513dbad4fa8c Mon Sep 17 00:00:00 2001 From: root <287494524@qq.com> Date: Wed, 4 Sep 2019 12:38:02 +0800 Subject: [PATCH 10/25] errata and basepoint_odd_lookup_table test for better understanding (cherry picked from commit 8da05f7e90b59b6dea6f72c4d4cad238647b1b60) Signed-off-by: Isis Lovecruft --- docs/parallel-formulas.md | 2 +- src/backend/vector/avx2/edwards.rs | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/parallel-formulas.md b/docs/parallel-formulas.md index 22f59cd..7f1e1c1 100644 --- a/docs/parallel-formulas.md +++ b/docs/parallel-formulas.md @@ -327,7 +327,7 @@ There are several directions for future improvement: [sandy2x]: https://eprint.iacr.org/2015/943.pdf [avx2trac]: https://trac.torproject.org/projects/tor/ticket/8897#comment:28 [hwcd08]: https://www.iacr.org/archive/asiacrypt2008/53500329/53500329.pdf -[curve_models]: https://doc-internal.dalek.rs/curve25519_dalek/curve_models/index.html +[curve_models]: https://doc-internal.dalek.rs/curve25519_dalek/backend/serial/curve_models/index.html [bbjlp08]: https://eprint.iacr.org/2008/013 [cmo98]: https://link.springer.com/content/pdf/10.1007%2F3-540-49649-1_6.pdf [intel]: https://software.intel.com/sites/default/files/managed/9e/bc/64-ia-32-architectures-optimization-manual.pdf diff --git a/src/backend/vector/avx2/edwards.rs b/src/backend/vector/avx2/edwards.rs index 8aadcc8..b8826d7 100644 --- a/src/backend/vector/avx2/edwards.rs +++ b/src/backend/vector/avx2/edwards.rs @@ -47,6 +47,7 @@ use traits::Identity; use super::constants; use super::field::{FieldElement2625x4, Lanes, Shuffle}; +use backend::vector::avx2::constants::{BASEPOINT_ODD_LOOKUP_TABLE}; /// A point on Curve25519, using parallel Edwards formulas for curve /// operations. @@ -188,7 +189,7 @@ impl From for CachedPoint { let mut x = P.0; x = x.blend(x.diff_sum(), Lanes::AB); - // x = (X1 - Y1, X2 + Y2, Z2, T2) = (S2 S3 Z2 T2) + // x = (Y2 - X2, Y2 + X2, Z2, T2) = (S2 S3 Z2 T2) x = x * (121666, 121666, 2 * 121666, 2 * 121665); // x = (121666*S2 121666*S3 2*121666*Z2 2*121665*T2) @@ -521,4 +522,23 @@ mod test { let P = &constants::ED25519_BASEPOINT_TABLE * &Scalar::from(8475983829u64); doubling_test_helper(P); } + + #[test] + fn basepoint_odd_lookup_table_verify() { + use constants; + + let basepoint_odd_table = NafLookupTable8::::from(&constants::ED25519_BASEPOINT_POINT); + println!("basepoint_odd_lookup_table = {:?}", basepoint_odd_table); + + let table_B = &BASEPOINT_ODD_LOOKUP_TABLE; + for (b_vec, base_vec) in table_B.0.iter().zip(basepoint_odd_table.0.iter()) { + let b_splits = b_vec.0.split(); + let base_splits = base_vec.0.split(); + + assert_eq!(base_splits[0], b_splits[0]); + assert_eq!(base_splits[1], b_splits[1]); + assert_eq!(base_splits[2], b_splits[2]); + assert_eq!(base_splits[3], b_splits[3]); + } + } } From 5ba95b13e4727ce9cb3f9675a4ad911d69f42c7d Mon Sep 17 00:00:00 2001 From: root <287494524@qq.com> Date: Wed, 4 Sep 2019 13:15:09 +0800 Subject: [PATCH 11/25] errata and basepoint_odd_lookup_table test for better understanding (cherry picked from commit 2d0c5323cbabc9a09473013411beec5da7aedcbe) Signed-off-by: Isis Lovecruft --- src/backend/vector/avx2/edwards.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/vector/avx2/edwards.rs b/src/backend/vector/avx2/edwards.rs index b8826d7..b25a557 100644 --- a/src/backend/vector/avx2/edwards.rs +++ b/src/backend/vector/avx2/edwards.rs @@ -47,7 +47,6 @@ use traits::Identity; use super::constants; use super::field::{FieldElement2625x4, Lanes, Shuffle}; -use backend::vector::avx2::constants::{BASEPOINT_ODD_LOOKUP_TABLE}; /// A point on Curve25519, using parallel Edwards formulas for curve /// operations. @@ -526,6 +525,7 @@ mod test { #[test] fn basepoint_odd_lookup_table_verify() { use constants; + use backend::vector::avx2::constants::{BASEPOINT_ODD_LOOKUP_TABLE}; let basepoint_odd_table = NafLookupTable8::::from(&constants::ED25519_BASEPOINT_POINT); println!("basepoint_odd_lookup_table = {:?}", basepoint_odd_table); From ab5af2e47c57e846c614e8dc70599c2064431849 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Fri, 8 Jan 2021 00:33:37 +0000 Subject: [PATCH 12/25] Whitespace fixes for 3267a5d merge. (cherry picked from commit 77ec9742120c7d2fec7003b992ab346fc6660c49) Signed-off-by: Isis Lovecruft --- docs/parallel-formulas.md | 2 +- src/backend/vector/avx2/edwards.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/parallel-formulas.md b/docs/parallel-formulas.md index 7f1e1c1..f84d1cc 100644 --- a/docs/parallel-formulas.md +++ b/docs/parallel-formulas.md @@ -327,7 +327,7 @@ There are several directions for future improvement: [sandy2x]: https://eprint.iacr.org/2015/943.pdf [avx2trac]: https://trac.torproject.org/projects/tor/ticket/8897#comment:28 [hwcd08]: https://www.iacr.org/archive/asiacrypt2008/53500329/53500329.pdf -[curve_models]: https://doc-internal.dalek.rs/curve25519_dalek/backend/serial/curve_models/index.html +[curve_models]: https://doc-internal.dalek.rs/curve25519_dalek/backend/serial/curve_models/index.html [bbjlp08]: https://eprint.iacr.org/2008/013 [cmo98]: https://link.springer.com/content/pdf/10.1007%2F3-540-49649-1_6.pdf [intel]: https://software.intel.com/sites/default/files/managed/9e/bc/64-ia-32-architectures-optimization-manual.pdf diff --git a/src/backend/vector/avx2/edwards.rs b/src/backend/vector/avx2/edwards.rs index b25a557..77af176 100644 --- a/src/backend/vector/avx2/edwards.rs +++ b/src/backend/vector/avx2/edwards.rs @@ -526,8 +526,8 @@ mod test { fn basepoint_odd_lookup_table_verify() { use constants; use backend::vector::avx2::constants::{BASEPOINT_ODD_LOOKUP_TABLE}; - - let basepoint_odd_table = NafLookupTable8::::from(&constants::ED25519_BASEPOINT_POINT); + + let basepoint_odd_table = NafLookupTable8::::from(&constants::ED25519_BASEPOINT_POINT); println!("basepoint_odd_lookup_table = {:?}", basepoint_odd_table); let table_B = &BASEPOINT_ODD_LOOKUP_TABLE; From e852e97d2d3f0bffde3f595592a6388414fe7d70 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Fri, 8 Jan 2021 03:25:44 +0000 Subject: [PATCH 13/25] Bump curve25519-dalek version to 2.1.2. --- Cargo.toml | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c5be1f3..3b9f538 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ name = "curve25519-dalek" # - update CHANGELOG # - update html_root_url # - update README if required by semver -version = "2.1.1" +version = "2.1.2" authors = ["Isis Lovecruft ", "Henry de Valence "] readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index f8384b1..a682ef0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,7 +21,7 @@ #![cfg_attr(feature = "nightly", doc(include = "../README.md"))] #![doc(html_logo_url = "https://doc.dalek.rs/assets/dalek-logo-clear.png")] -#![doc(html_root_url = "https://docs.rs/curve25519-dalek/2.1.1")] +#![doc(html_root_url = "https://docs.rs/curve25519-dalek/2.1.2")] //! Note that docs will only build on nightly Rust until //! [RFC 1990 stabilizes](https://github.com/rust-lang/rust/issues/44732). From 43e454ce1db9c3ab8621f8347f1019d43afd3b1a Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 13 Jul 2021 05:40:28 +0000 Subject: [PATCH 14/25] Fix documentation build errors due to doc(inlude) on nightly. --- src/lib.rs | 237 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 228 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a682ef0..19a0b6d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,21 +10,240 @@ #![no_std] #![cfg_attr(feature = "nightly", feature(test))] -#![cfg_attr(feature = "nightly", feature(external_doc))] #![cfg_attr(feature = "nightly", feature(doc_cfg))] #![cfg_attr(feature = "simd_backend", feature(stdsimd))] -// Refuse to compile if documentation is missing, but only on nightly. -// -// This means that missing docs will still fail CI, but means we can use -// README.md as the crate documentation. -#![cfg_attr(feature = "nightly", deny(missing_docs))] -#![cfg_attr(feature = "nightly", doc(include = "../README.md"))] +// Refuse to compile if documentation is missing. +#![deny(missing_docs)] + #![doc(html_logo_url = "https://doc.dalek.rs/assets/dalek-logo-clear.png")] #![doc(html_root_url = "https://docs.rs/curve25519-dalek/2.1.2")] -//! Note that docs will only build on nightly Rust until -//! [RFC 1990 stabilizes](https://github.com/rust-lang/rust/issues/44732). +//! # curve25519-dalek [![](https://img.shields.io/crates/v/curve25519-dalek.svg)](https://crates.io/crates/curve25519-dalek) [![](https://img.shields.io/badge/dynamic/json.svg?label=docs&uri=https%3A%2F%2Fcrates.io%2Fapi%2Fv1%2Fcrates%2Fcurve25519-dalek%2Fversions&query=%24.versions%5B0%5D.num&colorB=4F74A6)](https://doc.dalek.rs) [![](https://travis-ci.org/dalek-cryptography/curve25519-dalek.svg?branch=master)](https://travis-ci.org/dalek-cryptography/curve25519-dalek) +//! +//! +//! +//! **A pure-Rust implementation of group operations on Ristretto and Curve25519.** +//! +//! `curve25519-dalek` is a library providing group operations on the Edwards and +//! Montgomery forms of Curve25519, and on the prime-order Ristretto group. +//! +//! `curve25519-dalek` is not intended to provide implementations of any particular +//! crypto protocol. Rather, implementations of those protocols (such as +//! [`x25519-dalek`][x25519-dalek] and [`ed25519-dalek`][ed25519-dalek]) should use +//! `curve25519-dalek` as a library. +//! +//! `curve25519-dalek` is intended to provide a clean and safe _mid-level_ API for use +//! implementing a wide range of ECC-based crypto protocols, such as key agreement, +//! signatures, anonymous credentials, rangeproofs, and zero-knowledge proof +//! systems. +//! +//! In particular, `curve25519-dalek` implements Ristretto, which constructs a +//! prime-order group from a non-prime-order Edwards curve. This provides the +//! speed and safety benefits of Edwards curve arithmetic, without the pitfalls of +//! cofactor-related abstraction mismatches. +//! +//! # Documentation +//! +//! The semver-stable, public-facing `curve25519-dalek` API is documented +//! [here][docs-external]. In addition, the unstable internal implementation +//! details are documented [here][docs-internal]. +//! +//! The `curve25519-dalek` documentation requires a custom HTML header to include +//! KaTeX for math support. Unfortunately `cargo doc` does not currently support +//! this, but docs can be built using +//! ```sh +//! make doc +//! make doc-internal +//! ``` +//! +//! # Use +//! +//! To import `curve25519-dalek`, add the following to the dependencies section of +//! your project's `Cargo.toml`: +//! ```toml +//! curve25519-dalek = "3" +//! ``` +//! +//! The sole breaking change in the `3.x` series was an update to the `digest` +//! version, and in terms of non-breaking changes it includes: +//! +//! * support for using `alloc` instead of `std` on stable Rust, +//! * the Elligator2 encoding for Edwards points, +//! * a fix to use `packed_simd2`, +//! * various documentation fixes and improvements, +//! * support for configurably-sized, precomputed lookup tables for basepoint scalar +//! multiplication, +//! * two new formally-verified field arithmetic backends which use the Fiat Crypto +//! Rust code, which is generated from proofs of functional correctness checked by +//! the Coq theorem proving system, and +//! * support for explicitly calling the `zeroize` traits for all point types. +//! +//! The `2.x` series has API almost entirely unchanged from the `1.x` series, +//! except that: +//! +//! * an error in the data modeling for the (optional) `serde` feature was +//! corrected, so that when the `2.x`-series `serde` implementation is used +//! with `serde-bincode`, the derived serialization matches the usual X/Ed25519 +//! formats; +//! * the `rand` version was updated. +//! +//! See `CHANGELOG.md` for more details. +//! +//! # Backends and Features +//! +//! The `nightly` feature enables features available only when using a Rust nightly +//! compiler. In particular, it is required for rendering documentation and for +//! the SIMD backends. +//! +//! Curve arithmetic is implemented using one of the following backends: +//! +//! * a `u32` backend using serial formulas and `u64` products; +//! * a `u64` backend using serial formulas and `u128` products; +//! * an `avx2` backend using [parallel formulas][parallel_doc] and `avx2` instructions (sets speed records); +//! * an `ifma` backend using [parallel formulas][parallel_doc] and `ifma` instructions (sets speed records); +//! +//! By default the `u64` backend is selected. To select a specific backend, use: +//! ```sh +//! cargo build --no-default-features --features "std u32_backend" +//! cargo build --no-default-features --features "std u64_backend" +//! # Requires nightly, RUSTFLAGS="-C target_feature=+avx2" to use avx2 +//! cargo build --no-default-features --features "std simd_backend" +//! # Requires nightly, RUSTFLAGS="-C target_feature=+avx512ifma" to use ifma +//! cargo build --no-default-features --features "std simd_backend" +//! ``` +//! Crates using `curve25519-dalek` can either select a backend on behalf of their +//! users, or expose feature flags that control the `curve25519-dalek` backend. +//! +//! The `std` feature is enabled by default, but it can be disabled for no-`std` +//! builds using `--no-default-features`. Note that this requires explicitly +//! selecting an arithmetic backend using one of the `_backend` features. +//! If no backend is selected, compilation will fail. +//! +//! # Safety +//! +//! The `curve25519-dalek` types are designed to make illegal states +//! unrepresentable. For example, any instance of an `EdwardsPoint` is +//! guaranteed to hold a point on the Edwards curve, and any instance of a +//! `RistrettoPoint` is guaranteed to hold a valid point in the Ristretto +//! group. +//! +//! All operations are implemented using constant-time logic (no +//! secret-dependent branches, no secret-dependent memory accesses), +//! unless specifically marked as being variable-time code. +//! We believe that our constant-time logic is lowered to constant-time +//! assembly, at least on `x86_64` targets. +//! +//! As an additional guard against possible future compiler optimizations, +//! the `subtle` crate places an optimization barrier before every +//! conditional move or assignment. More details can be found in [the +//! documentation for the `subtle` crate][subtle_doc]. +//! +//! Some functionality (e.g., multiscalar multiplication or batch +//! inversion) requires heap allocation for temporary buffers. All +//! heap-allocated buffers of potentially secret data are explicitly +//! zeroed before release. +//! +//! However, we do not attempt to zero stack data, for two reasons. +//! First, it's not possible to do so correctly: we don't have control +//! over stack allocations, so there's no way to know how much data to +//! wipe. Second, because `curve25519-dalek` provides a mid-level API, +//! the correct place to start zeroing stack data is likely not at the +//! entrypoints of `curve25519-dalek` functions, but at the entrypoints of +//! functions in other crates. +//! +//! The implementation is memory-safe, and contains no significant +//! `unsafe` code. The SIMD backend uses `unsafe` internally to call SIMD +//! intrinsics. These are marked `unsafe` only because invoking them on an +//! inappropriate CPU would cause `SIGILL`, but the entire backend is only +//! compiled with appropriate `target_feature`s, so this cannot occur. +//! +//! # Performance +//! +//! Benchmarks are run using [`criterion.rs`][criterion]: +//! +//! ```sh +//! cargo bench --no-default-features --features "std u32_backend" +//! cargo bench --no-default-features --features "std u64_backend" +//! # Uses avx2 or ifma only if compiled for an appropriate target. +//! export RUSTFLAGS="-C target_cpu=native" +//! cargo bench --no-default-features --features "std simd_backend" +//! ``` +//! +//! Performance is a secondary goal behind correctness, safety, and +//! clarity, but we aim to be competitive with other implementations. +//! +//! # FFI +//! +//! Unfortunately, we have no plans to add FFI to `curve25519-dalek` directly. The +//! reason is that we use Rust features to provide an API that maintains safety +//! invariants, which are not possible to maintain across an FFI boundary. For +//! instance, as described in the _Safety_ section above, invalid points are +//! impossible to construct, and this would not be the case if we exposed point +//! operations over FFI. +//! +//! However, `curve25519-dalek` is designed as a *mid-level* API, aimed at +//! implementing other, higher-level primitives. Instead of providing FFI at the +//! mid-level, our suggestion is to implement the higher-level primitive (a +//! signature, PAKE, ZKP, etc) in Rust, using `curve25519-dalek` as a dependency, +//! and have that crate provide a minimal, byte-buffer-oriented FFI specific to +//! that primitive. +//! +//! # Contributing +//! +//! Please see [CONTRIBUTING.md][contributing]. +//! +//! Patches and pull requests should be make against the `develop` +//! branch, **not** `master`. +//! +//! # About +//! +//! **SPOILER ALERT:** *The Twelfth Doctor's first encounter with the Daleks is in +//! his second full episode, "Into the Dalek". A beleaguered ship of the "Combined +//! Galactic Resistance" has discovered a broken Dalek that has turned "good", +//! desiring to kill all other Daleks. The Doctor, Clara and a team of soldiers +//! are miniaturized and enter the Dalek, which the Doctor names Rusty. They +//! repair the damage, but accidentally restore it to its original nature, causing +//! it to go on the rampage and alert the Dalek fleet to the whereabouts of the +//! rebel ship. However, the Doctor manages to return Rusty to its previous state +//! by linking his mind with the Dalek's: Rusty shares the Doctor's view of the +//! universe's beauty, but also his deep hatred of the Daleks. Rusty destroys the +//! other Daleks and departs the ship, determined to track down and bring an end +//! to the Dalek race.* +//! +//! `curve25519-dalek` is authored by Isis Agora Lovecruft and Henry de Valence. +//! +//! Portions of this library were originally a port of [Adam Langley's +//! Golang ed25519 library](https://!github.com/agl/ed25519), which was in +//! turn a port of the reference `ref10` implementation. Most of this code, +//! including the 32-bit field arithmetic, has since been rewritten. +//! +//! The fast `u32` and `u64` scalar arithmetic was implemented by Andrew Moon, and +//! the addition chain for scalar inversion was provided by Brian Smith. The +//! optimised batch inversion was contributed by Sean Bowe and Daira Hopwood. +//! +//! The `no_std` and `zeroize` support was contributed by Tony Arcieri. +//! +//! The formally verified backends, `fiat_u32_backend` and `fiat_u64_backend`, which +//! integrate with the Rust generated by the +//! [Fiat Crypto project](https://github.com/mit-plv/fiat-crypto) were contributed +//! by François Garillot. +//! +//! Thanks also to Ashley Hauck, Lucas Salibian, Manish Goregaokar, Jack Grigg, +//! Pratyush Mishra, Michael Rosenberg, and countless others for their +//! contributions. +//! +//! [ed25519-dalek]: https://github.com/dalek-cryptography/ed25519-dalek +//! [x25519-dalek]: https://github.com/dalek-cryptography/x25519-dalek +//! [contributing]: https://github.com/dalek-cryptography/curve25519-dalek/blob/master/CONTRIBUTING.md +//! [docs-external]: https://doc.dalek.rs/curve25519_dalek/ +//! [docs-internal]: https://doc-internal.dalek.rs/curve25519_dalek/ +//! [criterion]: https://github.com/japaric/criterion.rs +//! [parallel_doc]: https://doc-internal.dalek.rs/curve25519_dalek/backend/vector/avx2/index.html +//! [subtle_doc]: https://doc.dalek.rs/subtle/ //------------------------------------------------------------------------ // External dependencies: From 1bacc6f95f9c0040598002b960d1b2051350e26e Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 13 Jul 2021 05:47:26 +0000 Subject: [PATCH 15/25] Update CHANGELOG for 2.1.2. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffa081f..fad16d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ major series. ## 2.x series +### 2.1.2 + +* Multiple documenation typo fixes. +* Fix `alloc` feature working with stable rust. + ### 2.1.1 * Update the optional `packed-simd` dependency to rely on a newer, From 233130c55baddb9eb679397bab54d3efe12229e3 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 13 Jul 2021 05:49:53 +0000 Subject: [PATCH 16/25] Update README with changes for 2.1.3. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fad16d6..96cf5d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ major series. ## 2.x series +### 2.1.3 + +* Fix documentation builds on nightly due to syntax changes to + `#![fg_attr(feature = "nightly", doc = include_str!("../README.md"))]`. + ### 2.1.2 * Multiple documenation typo fixes. From ff25109f25e2c1a62d5c86dd21f303f2365158c2 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 13 Jul 2021 05:57:44 +0000 Subject: [PATCH 17/25] Bump curve25519-dalek version to 2.1.3. --- Cargo.toml | 3 ++- src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3b9f538..eab4639 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,8 @@ name = "curve25519-dalek" # - update CHANGELOG # - update html_root_url # - update README if required by semver -version = "2.1.2" +# - if README was updated, also update module documenation in src/lib.rs +version = "2.1.3" authors = ["Isis Lovecruft ", "Henry de Valence "] readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index 19a0b6d..696f55d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,7 +17,7 @@ #![deny(missing_docs)] #![doc(html_logo_url = "https://doc.dalek.rs/assets/dalek-logo-clear.png")] -#![doc(html_root_url = "https://docs.rs/curve25519-dalek/2.1.2")] +#![doc(html_root_url = "https://docs.rs/curve25519-dalek/2.1.3")] //! # curve25519-dalek [![](https://img.shields.io/crates/v/curve25519-dalek.svg)](https://crates.io/crates/curve25519-dalek) [![](https://img.shields.io/badge/dynamic/json.svg?label=docs&uri=https%3A%2F%2Fcrates.io%2Fapi%2Fv1%2Fcrates%2Fcurve25519-dalek%2Fversions&query=%24.versions%5B0%5D.num&colorB=4F74A6)](https://doc.dalek.rs) [![](https://travis-ci.org/dalek-cryptography/curve25519-dalek.svg?branch=master)](https://travis-ci.org/dalek-cryptography/curve25519-dalek) //! From 6ea874cb314fa939c030831d6683134c09b3ae83 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 13 Jul 2021 06:44:49 +0000 Subject: [PATCH 18/25] Bump curve25519-dalek version to 3.0.3. --- Cargo.toml | 3 ++- src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b58f3f8..68dc725 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,8 @@ name = "curve25519-dalek" # - update CHANGELOG # - update html_root_url # - update README if required by semver -version = "3.0.1" +# - if README was updated, also update module documenation in src/lib.rs +version = "3.0.3" authors = ["Isis Lovecruft ", "Henry de Valence "] readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index af795a1..8a28814 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,7 +17,7 @@ #![deny(missing_docs)] #![doc(html_logo_url = "https://doc.dalek.rs/assets/dalek-logo-clear.png")] -#![doc(html_root_url = "https://docs.rs/curve25519-dalek/3.0.0")] +#![doc(html_root_url = "https://docs.rs/curve25519-dalek/3.0.3")] //! # curve25519-dalek [![](https://img.shields.io/crates/v/curve25519-dalek.svg)](https://crates.io/crates/curve25519-dalek) [![](https://img.shields.io/badge/dynamic/json.svg?label=docs&uri=https%3A%2F%2Fcrates.io%2Fapi%2Fv1%2Fcrates%2Fcurve25519-dalek%2Fversions&query=%24.versions%5B0%5D.num&colorB=4F74A6)](https://doc.dalek.rs) [![](https://travis-ci.org/dalek-cryptography/curve25519-dalek.svg?branch=master)](https://travis-ci.org/dalek-cryptography/curve25519-dalek) //! From b0abd7a84b68cbdd66f013768720a7e2a19de9d5 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 20 Jul 2021 01:49:10 +0000 Subject: [PATCH 19/25] Add missing CHANGELOG entry for 3.0.2. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62a24e6..d750259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ major series. ## 3.x series +### 3.0.2 + +* Multiple documenation typo fixes. +* Fixes to make using `alloc`+`no_std` possible for stable Rust. + ### 3.0.1 * Update the optional `packed-simd` dependency to rely on a newer, From dc19aa2aaf5bd097e861c7b5350f74d6ead65c96 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 20 Jul 2021 01:50:30 +0000 Subject: [PATCH 20/25] Add CHANGELOG entry for 3.0.3. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d750259..da98649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ major series. ## 3.x series +### 3.0.3 + +* Fix documentation builds on nightly due to syntax changes to + `#![fg_attr(feature = "nightly", doc = include_str!("../README.md"))]`. + ### 3.0.2 * Multiple documenation typo fixes. From 1391211f0626b6e9ccadca361cd0ee047801cebc Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 20 Jul 2021 02:56:07 +0000 Subject: [PATCH 21/25] Update CHANGELOG for 3.1.1. --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6433bc6..5dcd252 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ major series. ## 3.x series +### 3.1.1 + +* Fix documentation builds on nightly due to syntax changes to + `#![cfg_attr(feature = "nightly", doc = include_str!("../README.md"))]`. + ### 3.1.0 * Add support for the Elligator2 encoding for Edwards points. @@ -23,7 +28,7 @@ major series. ### 3.0.3 * Fix documentation builds on nightly due to syntax changes to - `#![fg_attr(feature = "nightly", doc = include_str!("../README.md"))]`. + `#![cfg_attr(feature = "nightly", doc = include_str!("../README.md"))]`. ### 3.0.2 From 49146274dba2cdd628232a8a0933d60e078c0fcd Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 20 Jul 2021 02:56:28 +0000 Subject: [PATCH 22/25] Fix a typo in Cargo.toml documentation. --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8a299de..92adefb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,8 +4,8 @@ name = "curve25519-dalek" # - update CHANGELOG # - update html_root_url # - update README if required by semver -# - if README was updated, also update module documenation in src/lib.rs -version = "3.1.0" +# - if README was updated, also update module documentation in src/lib.rs +version = "3.1.1" authors = ["Isis Lovecruft ", "Henry de Valence "] readme = "README.md" From fccc5d54f833057ed2a60a2bc35ab0c333eff79e Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 20 Jul 2021 02:56:44 +0000 Subject: [PATCH 23/25] Bump version for html_root_url. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7961baf..4baa4c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,7 +19,7 @@ #![deny(missing_docs)] #![doc(html_logo_url = "https://doc.dalek.rs/assets/dalek-logo-clear.png")] -#![doc(html_root_url = "https://docs.rs/curve25519-dalek/3.1.0")] +#![doc(html_root_url = "https://docs.rs/curve25519-dalek/3.1.1")] //! # curve25519-dalek [![](https://img.shields.io/crates/v/curve25519-dalek.svg)](https://crates.io/crates/curve25519-dalek) [![](https://img.shields.io/badge/dynamic/json.svg?label=docs&uri=https%3A%2F%2Fcrates.io%2Fapi%2Fv1%2Fcrates%2Fcurve25519-dalek%2Fversions&query=%24.versions%5B0%5D.num&colorB=4F74A6)](https://doc.dalek.rs) [![](https://travis-ci.org/dalek-cryptography/curve25519-dalek.svg?branch=master)](https://travis-ci.org/dalek-cryptography/curve25519-dalek) //! From f8cb7197f9a1a94294a5fc1f66c0e92de445fbd6 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 20 Jul 2021 03:02:09 +0000 Subject: [PATCH 24/25] Fix error introduced in 59a8616 merge. --- src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 4baa4c2..00d6126 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,7 +11,6 @@ #![no_std] #![cfg_attr(feature = "nightly", feature(test))] -#![cfg_attr(feature = "nightly", feature(external_doc))] #![cfg_attr(feature = "nightly", feature(doc_cfg))] #![cfg_attr(feature = "simd_backend", feature(stdsimd))] From b9710d59f268db0631fc117cc42c0c54c2fc0a6b Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 3 Aug 2021 22:49:09 +0000 Subject: [PATCH 25/25] Minor documentation fixes. --- Makefile | 2 +- src/backend/serial/scalar_mul/pippenger.rs | 2 +- src/montgomery.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e447175..7d87057 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -FEATURES := nightly yolocrypto avx2_backend +FEATURES := nightly simd_backend doc: cargo rustdoc --features "$(FEATURES)" -- --html-in-header docs/assets/rustdoc-include-katex-header.html diff --git a/src/backend/serial/scalar_mul/pippenger.rs b/src/backend/serial/scalar_mul/pippenger.rs index bffe140..575291d 100644 --- a/src/backend/serial/scalar_mul/pippenger.rs +++ b/src/backend/serial/scalar_mul/pippenger.rs @@ -58,7 +58,7 @@ use prelude::*; /// However, if `w` is too big and `n` is not too big, then `(2^w/2)*A` could dominate. /// Therefore, the optimal choice of `w` grows slowly as `n` grows. /// -/// This algorithm is adapted from section 4 of https://eprint.iacr.org/2012/549.pdf. +/// This algorithm is adapted from section 4 of . pub struct Pippenger; #[cfg(any(feature = "alloc", feature = "std"))] diff --git a/src/montgomery.rs b/src/montgomery.rs index de0f8b7..d7a20d3 100644 --- a/src/montgomery.rs +++ b/src/montgomery.rs @@ -159,7 +159,7 @@ impl MontgomeryPoint { /// Perform the Elligator2 mapping to a Montgomery point. /// -/// See https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-10#section-6.7.1 +/// See // // TODO Determine how much of the hash-to-group API should be exposed after the CFRG // draft gets into a more polished/accepted state.