Update curve25519-dalek to 4.0.0-pre.5 (#301)

* Update `curve25519-dalek`

* Improve documentation

* Update `voprf` to 0.5.0-pre.1
This commit is contained in:
daxpedda
2022-12-19 14:04:52 -08:00
committed by GitHub
parent 2dc2b0e617
commit 8901b74030
7 changed files with 44 additions and 75 deletions
+5 -5
View File
@@ -49,7 +49,7 @@ impl KeGroup for Curve25519 {
loop {
let scalar = Scalar::random(rng);
if scalar != Scalar::zero() {
if scalar != Scalar::ZERO {
break scalar;
}
}
@@ -69,7 +69,7 @@ impl KeGroup for Curve25519 {
let scalar = Scalar::from_bytes_mod_order_wide(&uniform_bytes.into());
if scalar == Scalar::zero() {
if scalar == Scalar::ZERO {
Err(InternalError::HashToScalar)
} else {
Ok(scalar)
@@ -77,7 +77,7 @@ impl KeGroup for Curve25519 {
}
fn is_zero_scalar(scalar: Self::Sk) -> subtle::Choice {
scalar.ct_eq(&Scalar::zero())
scalar.ct_eq(&Scalar::ZERO)
}
fn public_key(sk: Self::Sk) -> Self::Pk {
@@ -96,8 +96,8 @@ impl KeGroup for Curve25519 {
bytes
.try_into()
.ok()
.and_then(Scalar::from_canonical_bytes)
.filter(|scalar| scalar != &Scalar::zero())
.and_then(|bytes| Scalar::from_canonical_bytes(bytes).into())
.filter(|scalar| scalar != &Scalar::ZERO)
.ok_or(InternalError::PointError)
}
}
+4 -4
View File
@@ -66,7 +66,7 @@ impl KeGroup for Ristretto255 {
}
};
if scalar != Scalar::zero() {
if scalar != Scalar::ZERO {
break scalar;
}
}
@@ -84,7 +84,7 @@ impl KeGroup for Ristretto255 {
}
fn is_zero_scalar(scalar: Self::Sk) -> subtle::Choice {
scalar.ct_eq(&Scalar::zero())
scalar.ct_eq(&Scalar::ZERO)
}
fn public_key(sk: Self::Sk) -> Self::Pk {
@@ -103,8 +103,8 @@ impl KeGroup for Ristretto255 {
bytes
.try_into()
.ok()
.and_then(Scalar::from_canonical_bytes)
.filter(|scalar| scalar != &Scalar::zero())
.and_then(|bytes| Scalar::from_canonical_bytes(bytes).into())
.filter(|scalar| scalar != &Scalar::ZERO)
.ok_or(InternalError::PointError)
}
}