From 376eb16b9579f6d76eb8d3649f0763807c2220fd Mon Sep 17 00:00:00 2001 From: Davide Galassi Date: Fri, 13 Sep 2024 19:45:06 +0200 Subject: [PATCH] Revert --- src/lib.rs | 11 +++++++++-- src/utils/mod.rs | 36 ------------------------------------ 2 files changed, 9 insertions(+), 38 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 26a4304..94f0362 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -244,6 +244,13 @@ impl Secret { #[derive(Debug, Copy, Clone, PartialEq, CanonicalSerialize, CanonicalDeserialize)] pub struct Public(pub AffinePoint); +impl Public { + /// Construct from inner affine point. + pub fn from(value: AffinePoint) -> Self { + Self(value) + } +} + /// VRF input point generic over the cipher suite. #[derive(Debug, Clone, Copy, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] pub struct Input(pub AffinePoint); @@ -256,7 +263,7 @@ impl Input { /// Construct from inner affine point. pub fn from(value: AffinePoint) -> Self { - Input(value) + Self(value) } } @@ -267,7 +274,7 @@ pub struct Output(pub AffinePoint); impl Output { /// Construct from inner affine point. pub fn from(value: AffinePoint) -> Self { - Output(value) + Self(value) } /// Hash using `[Suite::point_to_hash]`. diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 5d546c7..3089a9c 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -35,41 +35,5 @@ macro_rules! suite_types { #[cfg(feature = "ring")] #[allow(dead_code)] pub type RingProof = $crate::ring::Proof<$suite>; - - impl From for Public { - fn from(p: AffinePoint) -> Self { - Self(p) - } - } - - impl From for AffinePoint { - fn from(p: Public) -> Self { - p.0 - } - } - - impl From for Input { - fn from(p: AffinePoint) -> Self { - Self(p) - } - } - - impl From for AffinePoint { - fn from(p: Input) -> Self { - p.0 - } - } - - impl From for Output { - fn from(p: AffinePoint) -> Self { - Self(p) - } - } - - impl From for AffinePoint { - fn from(p: Output) -> Self { - p.0 - } - } }; }