Merge branch 'release/3.2' into main

This commit is contained in:
Isis Lovecruft 2021-08-04 00:43:28 +00:00
commit 4f2a2e0319
No known key found for this signature in database
GPG key ID: AB41313533E8E812
5 changed files with 36 additions and 4 deletions

View file

@ -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.2
* Revert a commit which mistakenly removed support for `zeroize` traits
@ -37,7 +43,7 @@ major series.
### 3.0.2
* Multiple documenation typo fixes.
* Multiple documentation typo fixes.
* Fixes to make using `alloc`+`no_std` possible for stable Rust.
### 3.0.1

View file

@ -5,7 +5,7 @@ name = "curve25519-dalek"
# - update html_root_url
# - update README if required by semver
# - if README was updated, also update module documentation in src/lib.rs
version = "3.1.2"
version = "3.2.0"
authors = ["Isis Lovecruft <isis@patternsinthevoid.net>",
"Henry de Valence <hdevalence@hdevalence.ca>"]
readme = "README.md"

View file

@ -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

View file

@ -18,7 +18,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.2")]
#![doc(html_root_url = "https://docs.rs/curve25519-dalek/3.2.0")]
//! # 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)
//!

View file

@ -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,19 @@ 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]
fn identity_in_different_models() {
assert!(EdwardsPoint::identity().to_montgomery() == MontgomeryPoint::identity());
}
#[test]
#[cfg(feature = "serde")]
fn serde_bincode_basepoint_roundtrip() {