Re-export curve25519_dalek::RistrettoPoint for dalek_ff_group::RistrettoPoint

Sacrifices a `Hash` implementation (inefficient and already shouldn't be used)
we appear to have only used in two files (which have been patched).
This commit is contained in:
Luke Parker
2025-09-05 17:31:09 -04:00
parent 2216ade8c4
commit ea275df26c
3 changed files with 18 additions and 31 deletions

View File

@@ -8,7 +8,6 @@ use core::{
borrow::Borrow,
ops::{Deref, Add, AddAssign, Sub, SubAssign, Neg, Mul, MulAssign},
iter::{Iterator, Sum},
hash::{Hash, Hasher},
};
use zeroize::Zeroize;
@@ -20,9 +19,8 @@ use subtle::{Choice, CtOption};
use curve25519_dalek::{
edwards::{EdwardsPoint as DEdwardsPoint, CompressedEdwardsY},
ristretto::{RistrettoPoint as DRistrettoPoint, CompressedRistretto},
};
pub use curve25519_dalek::Scalar;
pub use curve25519_dalek::{Scalar, ristretto::RistrettoPoint};
use ::ciphersuite::group::{Group, GroupEncoding, prime::PrimeGroup};
@@ -259,17 +257,6 @@ macro_rules! dalek_group {
}
impl PrimeGroup for $Point {}
// Support being used as a key in a table
// While it is expensive as a key, due to the field operations required, there's frequently
// use cases for public key -> value lookups
#[allow(unknown_lints, renamed_and_removed_lints)]
#[allow(clippy::derived_hash_with_manual_eq, clippy::derive_hash_xor_eq)]
impl Hash for $Point {
fn hash<H: Hasher>(&self, state: &mut H) {
self.to_bytes().hash(state);
}
}
};
}
@@ -281,14 +268,6 @@ dalek_group!(
CompressedEdwardsY,
);
dalek_group!(
RistrettoPoint,
DRistrettoPoint,
|_| true,
RistrettoBasepointTable,
CompressedRistretto,
);
#[test]
fn test_ed25519_group() {
ff_group_tests::group::test_prime_group_bits::<_, EdwardsPoint>(&mut rand_core::OsRng);