Skip to content

Commit

Permalink
Depend on ProjectivePoint: ToEncodedPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jan 31, 2023
1 parent c8de516 commit 48f2f53
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/group/elliptic_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::{Error, InternalError, Result};
impl<C> Group for C
where
C: GroupDigest,
ProjectivePoint<Self>: CofactorGroup,
ProjectivePoint<Self>: CofactorGroup + ToEncodedPoint<Self>,
FieldSize<Self>: ModulusSize,
AffinePoint<Self>: FromEncodedPoint<Self> + ToEncodedPoint<Self>,
Scalar<Self>: FromOkm,
Expand Down Expand Up @@ -65,8 +65,7 @@ where
}

fn serialize_elem(elem: Self::Elem) -> GenericArray<u8, Self::ElemLen> {
let affine: AffinePoint<Self> = elem.into();
let bytes = affine.to_encoded_point(true);
let bytes = elem.to_encoded_point(true);
let bytes = bytes.as_bytes();
let mut result = GenericArray::default();
result[..bytes.len()].copy_from_slice(bytes);
Expand Down

0 comments on commit 48f2f53

Please sign in to comment.