Make tripleDH manipulate GenericArray<u8, N> over Vec<u8>

upgrade some of the structure contents of the KE types
This commit is contained in:
François Garillot
2020-09-19 19:16:28 -04:00
parent 84cc0e9b72
commit 3c555e82ae
5 changed files with 76 additions and 114 deletions
+2 -4
View File
@@ -86,8 +86,7 @@ impl Group for RistrettoPoint {
element_bits: &GenericArray<u8, Self::ElemLen>,
) -> Result<Self, InternalPakeError> {
CompressedRistretto::from_slice(element_bits)
.decompress()
.ok_or_else(|| InternalPakeError::PointError)
.decompress().ok_or(InternalPakeError::PointError)
}
// serialization of a group element
fn to_arr(&self) -> GenericArray<u8, Self::ElemLen> {
@@ -131,8 +130,7 @@ impl Group for EdwardsPoint {
element_bits: &GenericArray<u8, Self::ElemLen>,
) -> Result<Self, InternalPakeError> {
let point = CompressedEdwardsY::from_slice(element_bits)
.decompress()
.ok_or_else(|| InternalPakeError::PointError)?;
.decompress().ok_or(InternalPakeError::PointError)?;
if point.is_small_order() {
return Err(InternalPakeError::SubGroupError);