pub struct Input<S: Suite>(pub AffinePoint<S>);Expand description
VRF input point generic over the cipher suite.
Elliptic curve point representing the VRF input.
Tuple Fields§
§0: AffinePoint<S>Implementations§
Source§impl<S: Suite> Input<S>
impl<S: Suite> Input<S>
Sourcepub fn new(data: &[u8]) -> Option<Self>
pub fn new(data: &[u8]) -> Option<Self>
Construct from Suite::data_to_point.
Maps arbitrary data to a curve point via hash-to-curve.
Source§impl<S: Suite> Input<S>
impl<S: Suite> Input<S>
Sourcepub fn from_affine(value: AffinePoint<S>) -> Result<Self, Error>
pub fn from_affine(value: AffinePoint<S>) -> Result<Self, Error>
Construct from an affine point with subgroup validation.
Returns Error::InvalidData if the point is not in the prime-order subgroup.
Note: this only validates subgroup membership, not that the point was produced by hash-to-curve. The caller is still responsible for ensuring the point is not in a known discrete-log relation with the suite generator (required for Thin-VRF soundness).
Sourcepub fn from_affine_unchecked(value: AffinePoint<S>) -> Self
pub fn from_affine_unchecked(value: AffinePoint<S>) -> Self
Construct from an affine point without subgroup checks.
§Safety
The caller must ensure that value is in the prime-order subgroup and
was produced by a hash-to-curve procedure (or is otherwise not in a
known discrete-log relation with the suite generator). The latter is
required for the soundness of schemes like Thin-VRF where the input
and generator are delinearized into a single check.
Trait Implementations§
Source§impl<S: Suite> CanonicalDeserialize for Input<S>
impl<S: Suite> CanonicalDeserialize for Input<S>
Source§fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<Self, SerializationError>
fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
Source§impl<S: Suite> CanonicalSerialize for Input<S>
impl<S: Suite> CanonicalSerialize for Input<S>
Source§fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>
fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>
fn serialized_size(&self, compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
Source§impl<S: Suite> Valid for Input<S>
impl<S: Suite> Valid for Input<S>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send,
) -> Result<(), SerializationError>where
Self: 'a,
impl<S: Copy + Suite> Copy for Input<S>
impl<S: Eq + Suite> Eq for Input<S>
impl<S: Suite> StructuralPartialEq for Input<S>
Auto Trait Implementations§
impl<S> Freeze for Input<S>
impl<S> RefUnwindSafe for Input<S>
impl<S> Send for Input<S>
impl<S> Sync for Input<S>
impl<S> Unpin for Input<S>
impl<S> UnsafeUnpin for Input<S>
impl<S> UnwindSafe for Input<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
impl<T> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where
H: Digest,
fn hash_uncompressed<H>(
&self,
) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where
H: Digest,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more