pub struct VerifyingKey<C: IntrinsicCurve> { /* private fields */ }Implementations§
Source§impl<C: IntrinsicCurve> VerifyingKey<C>where
C::Point: WeierstrassPoint + Group + FromCompressed<<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate>,
<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: IntMod,
for<'a> &'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: Mul<&'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate, Output = <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate>,
impl<C: IntrinsicCurve> VerifyingKey<C>where
C::Point: WeierstrassPoint + Group + FromCompressed<<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate>,
<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: IntMod,
for<'a> &'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: Mul<&'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate, Output = <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate>,
pub fn new(public_key: PublicKey<C>) -> Self
pub fn from_sec1_bytes(bytes: &[u8]) -> Result<Self>
Sourcepub fn from_affine(point: <C as IntrinsicCurve>::Point) -> Result<Self>
pub fn from_affine(point: <C as IntrinsicCurve>::Point) -> Result<Self>
Convert an affine point into a verifying key.
This has the same validation behavior as PublicKey::from_affine.
pub fn to_sec1_bytes(&self, compress: bool) -> Vec<u8> ⓘ
pub fn as_affine(&self) -> &<C as IntrinsicCurve>::Point
pub fn into_affine(self) -> <C as IntrinsicCurve>::Point
Source§impl<C> VerifyingKey<C>where
C: IntrinsicCurve + PrimeCurve,
C::Point: WeierstrassPoint + CyclicGroup + FromCompressed<<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate> + VerifyCustomHook<C>,
<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: IntMod,
C::Scalar: IntMod + Reduce,
for<'a> &'a C::Point: Add<&'a C::Point, Output = C::Point>,
for<'a> &'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: Mul<&'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate, Output = <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate>,
FieldBytesSize<C>: ModulusSize,
SignatureSize<C>: ArrayLength<u8>,
impl<C> VerifyingKey<C>where
C: IntrinsicCurve + PrimeCurve,
C::Point: WeierstrassPoint + CyclicGroup + FromCompressed<<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate> + VerifyCustomHook<C>,
<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: IntMod,
C::Scalar: IntMod + Reduce,
for<'a> &'a C::Point: Add<&'a C::Point, Output = C::Point>,
for<'a> &'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: Mul<&'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate, Output = <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate>,
FieldBytesSize<C>: ModulusSize,
SignatureSize<C>: ArrayLength<u8>,
Sourcepub fn recover_from_msg(
msg: &[u8],
signature: &Signature<C>,
recovery_id: RecoveryId,
) -> Result<Self>where
C: DigestPrimitive,
pub fn recover_from_msg(
msg: &[u8],
signature: &Signature<C>,
recovery_id: RecoveryId,
) -> Result<Self>where
C: DigestPrimitive,
Recover a VerifyingKey from the given message, signature, and
RecoveryId.
The message is first hashed using this curve’s DigestPrimitive.
Sourcepub fn recover_from_digest<D>(
msg_digest: D,
signature: &Signature<C>,
recovery_id: RecoveryId,
) -> Result<Self>where
D: Digest,
pub fn recover_from_digest<D>(
msg_digest: D,
signature: &Signature<C>,
recovery_id: RecoveryId,
) -> Result<Self>where
D: Digest,
Recover a VerifyingKey from the given message Digest,
signature, and RecoveryId.
Sourcepub fn recover_from_prehash(
prehash: &[u8],
signature: &Signature<C>,
recovery_id: RecoveryId,
) -> Result<Self>
pub fn recover_from_prehash( prehash: &[u8], signature: &Signature<C>, recovery_id: RecoveryId, ) -> Result<Self>
Recover a VerifyingKey from the given prehash of a message, the
signature over that prehashed message, and a RecoveryId.
Note that this function does not verify the signature with the recovered key.
Source§impl<C> VerifyingKey<C>where
C: CurveArithmetic + IntrinsicCurve,
<C as IntrinsicCurve>::Point: FromEncodedPoint<C> + ToEncodedPoint<C> + Default + ConditionallySelectable,
FieldBytesSize<C>: ModulusSize,
impl<C> VerifyingKey<C>where
C: CurveArithmetic + IntrinsicCurve,
<C as IntrinsicCurve>::Point: FromEncodedPoint<C> + ToEncodedPoint<C> + Default + ConditionallySelectable,
FieldBytesSize<C>: ModulusSize,
Sourcepub fn from_encoded_point(public_key: &EncodedPoint<C>) -> Result<Self>
pub fn from_encoded_point(public_key: &EncodedPoint<C>) -> Result<Self>
Initialize VerifyingKey from an EncodedPoint.
Sourcepub fn to_encoded_point(&self, compress: bool) -> EncodedPoint<C>
pub fn to_encoded_point(&self, compress: bool) -> EncodedPoint<C>
Serialize this VerifyingKey as a SEC1 EncodedPoint, optionally
applying point compression.
Source§impl<C> VerifyingKey<C>where
C: IntrinsicCurve + PrimeCurve,
C::Point: WeierstrassPoint + CyclicGroup + FromCompressed<<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate>,
<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: IntMod,
C::Scalar: IntMod + Reduce,
impl<C> VerifyingKey<C>where
C: IntrinsicCurve + PrimeCurve,
C::Point: WeierstrassPoint + CyclicGroup + FromCompressed<<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate>,
<<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: IntMod,
C::Scalar: IntMod + Reduce,
Sourcepub fn recover_from_prehash_noverify(
prehash: &[u8],
sig: &[u8],
recovery_id: RecoveryId,
) -> Result<Self>where
for<'a> &'a C::Point: Add<&'a C::Point, Output = C::Point>,
for<'a> &'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: Mul<&'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate, Output = <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate>,
pub fn recover_from_prehash_noverify(
prehash: &[u8],
sig: &[u8],
recovery_id: RecoveryId,
) -> Result<Self>where
for<'a> &'a C::Point: Add<&'a C::Point, Output = C::Point>,
for<'a> &'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate: Mul<&'a <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate, Output = <<C as IntrinsicCurve>::Point as WeierstrassPoint>::Coordinate>,
§Assumption
To use this implementation, the Signature<C>, Coordinate<C>, and FieldBytes<C> should
all be encoded in big endian bytes. The implementation also assumes that
Scalar::<C>::NUM_LIMBS <= FieldBytesSize::<C>::USIZE <= Coordinate::<C>::NUM_LIMBS.
Recovery does not require additional signature verification: https://github.com/RustCrypto/signatures/pull/831