Adding reflected value check on client side

This commit is contained in:
Kevin Lewi
2021-07-14 18:10:35 -07:00
committed by Kevin Lewi
parent 8de2f37235
commit b4882f8810
7 changed files with 183 additions and 36 deletions
+7
View File
@@ -70,6 +70,9 @@ pub trait Group: Copy + Sized + for<'a> Mul<&'a <Self as Group>::Scalar, Output
/// Returns if the group element is equal to the identity (1)
fn is_identity(&self) -> bool;
/// Compares in constant time if the group elements are equal
fn ct_equal(&self, other: &Self) -> bool;
}
/// The implementation of such a subgroup for Ristretto
@@ -155,4 +158,8 @@ impl Group for RistrettoPoint {
fn is_identity(&self) -> bool {
self == &Self::identity()
}
fn ct_equal(&self, other: &Self) -> bool {
constant_time_eq::constant_time_eq(&self.to_arr(), &other.to_arr())
}
}