Struct tari_crypto::signatures::SchnorrSignature [−][src]
Implementations
impl<P, K> SchnorrSignature<P, K> where
P: PublicKey<K = K>,
K: SecretKey,
[src]
P: PublicKey<K = K>,
K: SecretKey,
pub fn new(public_nonce: P, signature: K) -> Self
[src]
pub fn calc_signature_verifier(&self) -> P
[src]
pub fn sign(
secret: K,
nonce: K,
challenge: &[u8]
) -> Result<Self, SchnorrSignatureError> where
K: Add<Output = K> + Mul<P, Output = P> + Mul<Output = K>,
[src]
secret: K,
nonce: K,
challenge: &[u8]
) -> Result<Self, SchnorrSignatureError> where
K: Add<Output = K> + Mul<P, Output = P> + Mul<Output = K>,
pub fn verify_challenge<'a>(&self, public_key: &'a P, challenge: &[u8]) -> bool where
&'b K: Mul<&'a P, Output = P>,
&'b P: Add<P, Output = P>,
[src]
&'b K: Mul<&'a P, Output = P>,
&'b P: Add<P, Output = P>,
pub fn verify<'a>(&self, public_key: &'a P, challenge: &K) -> bool where
&'b K: Mul<&'a P, Output = P>,
&'b P: Add<P, Output = P>,
[src]
&'b K: Mul<&'a P, Output = P>,
&'b P: Add<P, Output = P>,
pub fn get_signature(&self) -> &K
[src]
pub fn get_public_nonce(&self) -> &P
[src]
Trait Implementations
impl<'a, 'b, P, K> Add<&'b SchnorrSignature<P, K>> for &'a SchnorrSignature<P, K> where
P: PublicKey<K = K>,
&'a P: Add<&'b P, Output = P>,
K: SecretKey,
&'a K: Add<&'b K, Output = K>,
[src]
P: PublicKey<K = K>,
&'a P: Add<&'b P, Output = P>,
K: SecretKey,
&'a K: Add<&'b K, Output = K>,
type Output = SchnorrSignature<P, K>
The resulting type after applying the +
operator.
fn add(self, rhs: &'b SchnorrSignature<P, K>) -> SchnorrSignature<P, K>
[src]
impl<'a, P, K> Add<SchnorrSignature<P, K>> for &'a SchnorrSignature<P, K> where
P: PublicKey<K = K>,
&'a P: Add<&'b P, Output = P>,
K: SecretKey,
&'a K: Add<&'b K, Output = K>,
[src]
P: PublicKey<K = K>,
&'a P: Add<&'b P, Output = P>,
K: SecretKey,
&'a K: Add<&'b K, Output = K>,
type Output = SchnorrSignature<P, K>
The resulting type after applying the +
operator.
fn add(self, rhs: SchnorrSignature<P, K>) -> SchnorrSignature<P, K>
[src]
impl<P: Clone, K: Clone> Clone for SchnorrSignature<P, K>
[src]
fn clone(&self) -> SchnorrSignature<P, K>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<P: Copy, K: Copy> Copy for SchnorrSignature<P, K>
[src]
impl<P: Debug, K: Debug> Debug for SchnorrSignature<P, K>
[src]
impl<P, K> Default for SchnorrSignature<P, K> where
P: PublicKey<K = K>,
K: SecretKey,
[src]
P: PublicKey<K = K>,
K: SecretKey,
impl<'de, P, K> Deserialize<'de> for SchnorrSignature<P, K> where
P: Deserialize<'de>,
K: Deserialize<'de>,
[src]
P: Deserialize<'de>,
K: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<P: Eq, K: Eq> Eq for SchnorrSignature<P, K>
[src]
impl From<SchnorrSignature<RistrettoPublicKey, RistrettoSecretKey>> for StackItem
[src]
fn from(item: RistrettoSchnorr) -> Self
[src]
impl<P: Hash, K: Hash> Hash for SchnorrSignature<P, K>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<P, K> Ord for SchnorrSignature<P, K> where
P: Eq + Ord,
K: Eq + ByteArray,
[src]
P: Eq + Ord,
K: Eq + ByteArray,
Provide an efficient ordering algorithm for Schnorr signatures. It’s probably not a good idea to implement Ord
for secret keys, but in this instance, the signature is publicly known and is simply a scalar, so we use the hex
representation of the scalar as the canonical ordering metric. This conversion is done if and only if the public
nonces are already equal, otherwise the public nonce ordering determines the SchnorrSignature order.
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<P: PartialEq, K: PartialEq> PartialEq<SchnorrSignature<P, K>> for SchnorrSignature<P, K>
[src]
fn eq(&self, other: &SchnorrSignature<P, K>) -> bool
[src]
fn ne(&self, other: &SchnorrSignature<P, K>) -> bool
[src]
impl<P, K> PartialOrd<SchnorrSignature<P, K>> for SchnorrSignature<P, K> where
P: Eq + Ord,
K: Eq + ByteArray,
[src]
P: Eq + Ord,
K: Eq + ByteArray,
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<P, K> Serialize for SchnorrSignature<P, K> where
P: Serialize,
K: Serialize,
[src]
P: Serialize,
K: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<P, K> StructuralEq for SchnorrSignature<P, K>
[src]
impl<P, K> StructuralPartialEq for SchnorrSignature<P, K>
[src]
Auto Trait Implementations
impl<P, K> RefUnwindSafe for SchnorrSignature<P, K> where
K: RefUnwindSafe,
P: RefUnwindSafe,
K: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, K> Send for SchnorrSignature<P, K> where
K: Send,
P: Send,
K: Send,
P: Send,
impl<P, K> Sync for SchnorrSignature<P, K> where
K: Sync,
P: Sync,
K: Sync,
P: Sync,
impl<P, K> Unpin for SchnorrSignature<P, K> where
K: Unpin,
P: Unpin,
K: Unpin,
P: Unpin,
impl<P, K> UnwindSafe for SchnorrSignature<P, K> where
K: UnwindSafe,
P: UnwindSafe,
K: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
U: FromCast<T>,
pub fn cast(self) -> U
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
[src]
T: InitializableFromZeroed + ?Sized,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> FromBits<T> for T
pub fn from_bits(t: T) -> T
impl<T> FromCast<T> for T
pub fn from_cast(t: T) -> T
impl<T> InitializableFromZeroed for T where
T: Default,
[src]
T: Default,
pub unsafe fn initialize(place: *mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
U: FromBits<T>,
pub fn into_bits(self) -> U
impl<T> MessageFormat for T where
T: DeserializeOwned + Serialize,
[src]
T: DeserializeOwned + Serialize,
pub fn to_binary(&self) -> Result<Vec<u8, Global>, MessageFormatError>
[src]
pub fn to_json(&self) -> Result<String, MessageFormatError>
[src]
pub fn to_base64(&self) -> Result<String, MessageFormatError>
[src]
pub fn from_binary(msg: &[u8]) -> Result<T, MessageFormatError>
[src]
pub fn from_json(msg: &str) -> Result<T, MessageFormatError>
[src]
pub fn from_base64(msg: &str) -> Result<T, MessageFormatError>
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,