Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
davxy committed Sep 13, 2024
1 parent 6867897 commit 376eb16
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
11 changes: 9 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,13 @@ impl<S: Suite> Secret<S> {
#[derive(Debug, Copy, Clone, PartialEq, CanonicalSerialize, CanonicalDeserialize)]
pub struct Public<S: Suite>(pub AffinePoint<S>);

impl<S: Suite> Public<S> {
/// Construct from inner affine point.
pub fn from(value: AffinePoint<S>) -> Self {
Self(value)
}
}

/// VRF input point generic over the cipher suite.
#[derive(Debug, Clone, Copy, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)]
pub struct Input<S: Suite>(pub AffinePoint<S>);
Expand All @@ -256,7 +263,7 @@ impl<S: Suite> Input<S> {

/// Construct from inner affine point.
pub fn from(value: AffinePoint<S>) -> Self {
Input(value)
Self(value)
}
}

Expand All @@ -267,7 +274,7 @@ pub struct Output<S: Suite>(pub AffinePoint<S>);
impl<S: Suite> Output<S> {
/// Construct from inner affine point.
pub fn from(value: AffinePoint<S>) -> Self {
Output(value)
Self(value)
}

/// Hash using `[Suite::point_to_hash]`.
Expand Down
36 changes: 0 additions & 36 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,41 +35,5 @@ macro_rules! suite_types {
#[cfg(feature = "ring")]
#[allow(dead_code)]
pub type RingProof = $crate::ring::Proof<$suite>;

impl From<AffinePoint> for Public {
fn from(p: AffinePoint) -> Self {
Self(p)
}
}

impl From<Public> for AffinePoint {
fn from(p: Public) -> Self {
p.0
}
}

impl From<AffinePoint> for Input {
fn from(p: AffinePoint) -> Self {
Self(p)
}
}

impl From<Input> for AffinePoint {
fn from(p: Input) -> Self {
p.0
}
}

impl From<AffinePoint> for Output {
fn from(p: AffinePoint) -> Self {
Self(p)
}
}

impl From<Output> for AffinePoint {
fn from(p: Output) -> Self {
p.0
}
}
};
}

0 comments on commit 376eb16

Please sign in to comment.