pub struct EdDSAPublicKey {
pub pk: Affine<EdwardsConfig>,
}Expand description
A public key for the EdDSA signature scheme over the BabyJubJubCurve.
Fields§
§pk: Affine<EdwardsConfig>Implementations§
Source§impl EdDSAPublicKey
impl EdDSAPublicKey
Sourcepub fn verify(
&self,
message: Fp<MontBackend<FrConfig, 4>, 4>,
signature: &EdDSASignature,
) -> bool
pub fn verify( &self, message: Fp<MontBackend<FrConfig, 4>, 4>, signature: &EdDSASignature, ) -> bool
Verify the signature against the given message and public key.
This verification function follows https://eprint.iacr.org/2020/1244.pdf to avoid common pitfalls. In particular, this uses a so-called “cofactored” verification, such that batched signature verification is possible.
The only assumption is that both the public key and the nonce point R are canonical, i.e., their encoding is using valid field elements, which must be checked during deserialization.
Sourcepub fn to_compressed_bytes(&self) -> Result<[u8; 32], Report>
pub fn to_compressed_bytes(&self) -> Result<[u8; 32], Report>
Serialize the public key to a compressed byte array.
Sourcepub fn from_compressed_bytes(bytes: [u8; 32]) -> Result<EdDSAPublicKey, Report>
pub fn from_compressed_bytes(bytes: [u8; 32]) -> Result<EdDSAPublicKey, Report>
Parse the public key from a byte array with the point in compressed format.
Trait Implementations§
Source§impl Clone for EdDSAPublicKey
impl Clone for EdDSAPublicKey
Source§fn clone(&self) -> EdDSAPublicKey
fn clone(&self) -> EdDSAPublicKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EdDSAPublicKey
impl Debug for EdDSAPublicKey
Source§impl<'de> Deserialize<'de> for EdDSAPublicKey
impl<'de> Deserialize<'de> for EdDSAPublicKey
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EdDSAPublicKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EdDSAPublicKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for EdDSAPublicKey
impl Hash for EdDSAPublicKey
Source§impl PartialEq for EdDSAPublicKey
impl PartialEq for EdDSAPublicKey
Source§impl Serialize for EdDSAPublicKey
impl Serialize for EdDSAPublicKey
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for EdDSAPublicKey
impl StructuralPartialEq for EdDSAPublicKey
Auto Trait Implementations§
impl Freeze for EdDSAPublicKey
impl RefUnwindSafe for EdDSAPublicKey
impl Send for EdDSAPublicKey
impl Sync for EdDSAPublicKey
impl Unpin for EdDSAPublicKey
impl UnsafeUnpin for EdDSAPublicKey
impl UnwindSafe for EdDSAPublicKey
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
Mutably borrows from an owned value. Read more
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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