[−][src]Struct tari_crypto::ristretto::ristretto_keys::RistrettoPublicKey
The PublicKey implementation for ristretto255
is a thin wrapper around the dalek
library's RistrettoPoint.
Creating public keys
Both PublicKey and ByteArray are implemented on
RistrettoPublicKey
so all of the following will work:
use tari_crypto::ristretto::{ RistrettoPublicKey, RistrettoSecretKey }; use tari_utilities::{ ByteArray, hex::Hex }; use tari_crypto::keys::{ PublicKey, SecretKey }; use rand; let mut rng = rand::thread_rng(); let _p1 = RistrettoPublicKey::from_bytes(&[224, 196, 24, 247, 200, 217, 196, 205, 215, 57, 91, 147, 234, 18, 79, 58, 217, 144, 33, 187, 104, 29, 252, 51, 2, 169, 217, 154, 46, 83, 230, 78]); let _p2 = RistrettoPublicKey::from_hex(&"e882b131016b52c1d3337080187cf768423efccbb517bb495ab812c4160ff44e"); let sk = RistrettoSecretKey::random(&mut rng); let _p3 = RistrettoPublicKey::from_secret_key(&sk);
Trait Implementations
impl<'a, 'b> Add<&'b RistrettoPublicKey> for &'a RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the +
operator.
fn add(self, rhs: &'b RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl<'b> Add<&'b RistrettoPublicKey> for RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the +
operator.
fn add(self, rhs: &'b RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl<'a> Add<RistrettoPublicKey> for &'a RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the +
operator.
fn add(self, rhs: RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl Add<RistrettoPublicKey> for RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the +
operator.
fn add(self, rhs: RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl ByteArray for RistrettoPublicKey
[src]
fn from_bytes(bytes: &[u8]) -> Result<RistrettoPublicKey, ByteArrayError> where
Self: Sized,
[src]
Self: Sized,
Create a new RistrettoPublicKey
instance form the given byte array. The constructor returns errors under
the following circumstances:
- The byte array is not exactly 32 bytes
- The byte array does not represent a valid (compressed) point on the ristretto255 curve
fn as_bytes(&self) -> &[u8]
[src]
Return the little-endian byte array representation of the compressed public key
fn to_vec(&self) -> Vec<u8>
[src]
fn from_vec(v: &Vec<u8>) -> Result<Self, ByteArrayError>
[src]
impl Clone for RistrettoPublicKey
[src]
fn clone(&self) -> RistrettoPublicKey
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for RistrettoPublicKey
[src]
impl Default for RistrettoPublicKey
[src]
impl<'de> Deserialize<'de> for RistrettoPublicKey
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl DiffieHellmanSharedSecret for RistrettoPublicKey
[src]
type PK = RistrettoPublicKey
fn shared_secret(k: &<Self::PK as PublicKey>::K, pk: &Self::PK) -> Self::PK
[src]
Generate a shared secret from one party's private key and another party's public key
impl Display for RistrettoPublicKey
[src]
impl Eq for RistrettoPublicKey
[src]
impl ExtendBytes for RistrettoPublicKey
[src]
fn append_raw_bytes(&self, buf: &mut Vec<u8>)
[src]
impl<'_> From<&'_ RistrettoPublicKey> for RistrettoPoint
[src]
fn from(pk: &RistrettoPublicKey) -> Self
[src]
impl From<RistrettoPublicKey> for RistrettoPoint
[src]
fn from(pk: RistrettoPublicKey) -> Self
[src]
impl From<RistrettoPublicKey> for CompressedRistretto
[src]
fn from(pk: RistrettoPublicKey) -> Self
[src]
impl From<RistrettoPublicKey> for StackItem
[src]
fn from(item: RistrettoPublicKey) -> Self
[src]
impl Hash for RistrettoPublicKey
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
Require the implementation of the Hash trait for Hashmaps
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Hashable for RistrettoPublicKey
[src]
impl<'a, 'b> Mul<&'b RistrettoPublicKey> for &'a RistrettoSecretKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl<'b> Mul<&'b RistrettoPublicKey> for RistrettoSecretKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl<'a, 'b> Mul<&'b RistrettoSecretKey> for &'a RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b RistrettoSecretKey) -> RistrettoPublicKey
[src]
impl<'b> Mul<&'b RistrettoSecretKey> for RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b RistrettoSecretKey) -> RistrettoPublicKey
[src]
impl<'a> Mul<RistrettoPublicKey> for &'a RistrettoSecretKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the *
operator.
fn mul(self, rhs: RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl Mul<RistrettoPublicKey> for RistrettoSecretKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the *
operator.
fn mul(self, rhs: RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl<'a> Mul<RistrettoSecretKey> for &'a RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the *
operator.
fn mul(self, rhs: RistrettoSecretKey) -> RistrettoPublicKey
[src]
impl Mul<RistrettoSecretKey> for RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the *
operator.
fn mul(self, rhs: RistrettoSecretKey) -> RistrettoPublicKey
[src]
impl Ord for RistrettoPublicKey
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<RistrettoPublicKey> for RistrettoPublicKey
[src]
fn eq(&self, other: &RistrettoPublicKey) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<RistrettoPublicKey> for RistrettoPublicKey
[src]
fn partial_cmp(&self, other: &RistrettoPublicKey) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PublicKey for RistrettoPublicKey
[src]
type K = RistrettoSecretKey
fn from_secret_key(k: &Self::K) -> RistrettoPublicKey
[src]
Generates a new Public key from the given secret key
fn key_length() -> usize
[src]
fn batch_mul(scalars: &[Self::K], points: &[Self]) -> Self
[src]
fn random_keypair<R: Rng + CryptoRng>(rng: &mut R) -> (Self::K, Self)
[src]
impl Serialize for RistrettoPublicKey
[src]
impl<'a, 'b> Sub<&'b RistrettoPublicKey> for &'a RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the -
operator.
fn sub(self, rhs: &RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl<'b> Sub<&'b RistrettoPublicKey> for RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl<'a> Sub<RistrettoPublicKey> for &'a RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the -
operator.
fn sub(self, rhs: RistrettoPublicKey) -> RistrettoPublicKey
[src]
impl Sub<RistrettoPublicKey> for RistrettoPublicKey
[src]
type Output = RistrettoPublicKey
The resulting type after applying the -
operator.
fn sub(self, rhs: RistrettoPublicKey) -> RistrettoPublicKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for RistrettoPublicKey
impl Send for RistrettoPublicKey
impl Sync for RistrettoPublicKey
impl Unpin for RistrettoPublicKey
impl UnwindSafe for RistrettoPublicKey
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
U: FromCast<T>,
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
fn from_bits(t: T) -> T
impl<T> FromCast<T> for T
fn from_cast(t: T) -> T
impl<T> Hex for T where
T: ByteArray,
[src]
T: ByteArray,
impl<T> InitializableFromZeroed for T where
T: Default,
[src]
T: Default,
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>,
fn into_bits(self) -> U
impl<T> MessageFormat for T where
T: DeserializeOwned + Serialize,
[src]
T: DeserializeOwned + Serialize,
fn to_binary(&self) -> Result<Vec<u8>, MessageFormatError>
[src]
fn to_json(&self) -> Result<String, MessageFormatError>
[src]
fn to_base64(&self) -> Result<String, MessageFormatError>
[src]
fn from_binary(msg: &[u8]) -> Result<T, MessageFormatError>
[src]
fn from_json(msg: &str) -> Result<T, MessageFormatError>
[src]
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.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
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.
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>,