From 032a14cfa50e62fa4568bfcc4e127387232f9773 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Wed, 14 Apr 2021 03:05:51 +0000 Subject: [PATCH 1/4] Update README to thank more contributors. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 19679f9..2600cce 100644 --- a/README.md +++ b/README.md @@ -207,7 +207,13 @@ optimised batch inversion was contributed by Sean Bowe and Daira Hopwood. The `no_std` and `zeroize` support was contributed by Tony Arcieri. -Thanks also to Ashley Hauck, Lucas Salibian, and Manish Goregaokar for their +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 From 0d8f33153c144632e97b5a49cefe1e66a292463a Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 20 Apr 2021 23:58:29 +0000 Subject: [PATCH 2/4] Implement Identity for MontgomeryPoint. This can be used in checks for non-contributory behaviour in protocols where that is a concern. --- src/montgomery.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/montgomery.rs b/src/montgomery.rs index de0f8b7..867496c 100644 --- a/src/montgomery.rs +++ b/src/montgomery.rs @@ -94,6 +94,13 @@ impl PartialEq for MontgomeryPoint { impl Eq for MontgomeryPoint {} +impl Identity for MontgomeryPoint { + /// Return the group identity element, which has order 4. + fn identity() -> MontgomeryPoint { + MontgomeryPoint([0u8; 32]) + } +} + impl Zeroize for MontgomeryPoint { fn zeroize(&mut self) { self.0.zeroize(); @@ -351,6 +358,14 @@ mod test { use rand_core::OsRng; + #[test] + fn identity_in_different_coordinates() { + let id_projective = ProjectivePoint::identity(); + let id_montgomery = id_projective.to_affine(); + + assert!(id_montgomery == MontgomeryPoint::identity()); + } + #[test] #[cfg(feature = "serde")] fn serde_bincode_basepoint_roundtrip() { From d7c2a1394f6b1ba2aaa8152b563cb221f7d4c710 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Wed, 21 Apr 2021 00:06:44 +0000 Subject: [PATCH 3/4] Add another test for equivalence with the Edwards identity. --- src/montgomery.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/montgomery.rs b/src/montgomery.rs index 867496c..ef4d0f5 100644 --- a/src/montgomery.rs +++ b/src/montgomery.rs @@ -366,6 +366,11 @@ mod test { assert!(id_montgomery == MontgomeryPoint::identity()); } + #[test] + fn identity_in_different_models() { + assert!(EdwardsPoint::identity().to_montgomery() == MontgomeryPoint::identity()); + } + #[test] #[cfg(feature = "serde")] fn serde_bincode_basepoint_roundtrip() { From 1ee5c4defb3a9501a93c91d2f0b3e42bfc814039 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 13 Jul 2021 05:28:35 +0000 Subject: [PATCH 4/4] Update CHANGELOG and bump version to 3.2. --- CHANGELOG.md | 6 ++++++ Cargo.toml | 2 +- src/lib.rs | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d42492..9492167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ major series. ## 3.x series +### 3.2.0 + +* Add support for getting the identity element for the Montgomery + form of curve25519, which is useful in certain protocols for + checking contributory behaviour in derivation of shared secrets. + ### 3.1.0 * Add support for the Elligator2 encoding for Edwards points. diff --git a/Cargo.toml b/Cargo.toml index fb6f627..e777056 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 = "3.1.0" +version = "3.2.0" authors = ["Isis Lovecruft ", "Henry de Valence "] readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index 13f9393..0b00360 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/3.1.0")] +#![doc(html_root_url = "https://docs.rs/curve25519-dalek/3.2.0")] //! Note that docs will only build on nightly Rust until //! [RFC 1990 stabilizes](https://github.com/rust-lang/rust/issues/44732).