Update curve25519-dalek to 4.0.0-rc.1 (#261)

* Update curve25519-dalek requirement from =4.0.0-pre.1 to =4.0.0-rc.1

Updates the requirements on [curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek) to permit the latest version.
- [Release notes](https://github.com/dalek-cryptography/curve25519-dalek/releases)
- [Changelog](https://github.com/dalek-cryptography/curve25519-dalek/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dalek-cryptography/curve25519-dalek/commits)

---
updated-dependencies:
- dependency-name: curve25519-dalek
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix breaking curve25519-dalek changes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
Conrado Gouvea 2023-03-07 13:03:33 -03:00 committed by GitHub
parent e5ecb2d3f4
commit c80e812fb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 10 deletions

View File

@ -33,7 +33,7 @@ serde_json = { version = "1.0", optional = true }
criterion = { version = "0.4", optional = true }
[dev-dependencies]
curve25519-dalek = { version = "=4.0.0-pre.1", features = ["serde"] }
curve25519-dalek = { version = "=4.0.0-rc.1", features = ["serde"] }
lazy_static = "1.4"
proptest = "1.0"
rand = "0.8"

View File

@ -22,7 +22,7 @@ description = "A Schnorr signature scheme over the prime-order Ristretto group t
features = ["nightly"]
[dependencies]
curve25519-dalek = { version = "=4.0.0-pre.1", features = ["serde"] }
curve25519-dalek = { version = "=4.0.0-rc.1", features = ["serde"] }
frost-core = { path = "../frost-core", features = ["test-impl"] }
frost-ristretto255 = { path = "../frost-ristretto255" }
rand_core = "0.6"

View File

@ -34,7 +34,7 @@ impl Group for Ed25519Group {
type Serialization = [u8; 32];
fn cofactor() -> <Self::Field as Field>::Scalar {
Scalar::one()
Scalar::ONE
}
fn identity() -> Self::Element {
@ -50,7 +50,10 @@ impl Group for Ed25519Group {
}
fn deserialize(buf: &Self::Serialization) -> Result<Self::Element, GroupError> {
match CompressedEdwardsY::from_slice(buf.as_ref()).decompress() {
match CompressedEdwardsY::from_slice(buf.as_ref())
.map_err(|_| GroupError::MalformedElement)?
.decompress()
{
Some(point) => {
if point == Self::identity() {
Err(GroupError::InvalidIdentityElement)

View File

@ -18,7 +18,7 @@ description = "A Schnorr signature scheme over the prime-order Ristretto group t
features = ["nightly"]
[dependencies]
curve25519-dalek = { version = "=4.0.0-pre.1", features = ["serde"] }
curve25519-dalek = { version = "=4.0.0-rc.1", features = ["serde", "rand_core"] }
frost-core = { path = "../frost-core", features = ["test-impl"] }
rand_core = "0.6"
sha2 = "0.10.2"

View File

@ -29,11 +29,11 @@ impl Field for RistrettoScalarField {
type Serialization = [u8; 32];
fn zero() -> Self::Scalar {
Scalar::zero()
Scalar::ZERO
}
fn one() -> Self::Scalar {
Scalar::one()
Scalar::ONE
}
fn invert(scalar: &Self::Scalar) -> Result<Self::Scalar, FieldError> {
@ -55,7 +55,7 @@ impl Field for RistrettoScalarField {
}
fn deserialize(buf: &Self::Serialization) -> Result<Self::Scalar, FieldError> {
match Scalar::from_canonical_bytes(*buf) {
match Scalar::from_canonical_bytes(*buf).into() {
Some(s) => Ok(s),
None => Err(FieldError::MalformedScalar),
}
@ -78,7 +78,7 @@ impl Group for RistrettoGroup {
type Serialization = [u8; 32];
fn cofactor() -> <Self::Field as Field>::Scalar {
Scalar::one()
Scalar::ONE
}
fn identity() -> Self::Element {
@ -94,7 +94,10 @@ impl Group for RistrettoGroup {
}
fn deserialize(buf: &Self::Serialization) -> Result<Self::Element, GroupError> {
match CompressedRistretto::from_slice(buf.as_ref()).decompress() {
match CompressedRistretto::from_slice(buf.as_ref())
.map_err(|_| GroupError::MalformedElement)?
.decompress()
{
Some(point) => {
if point == Self::identity() {
Err(GroupError::InvalidIdentityElement)