[−][src]Struct tari_crypto::ristretto::ristretto_keys::RistrettoSecretKey
The SecretKey implementation for Ristretto is a thin wrapper around the Dalek Scalar type, representing a 256-bit integer (mod the group order).
Creating secret keys
ByteArray and SecretKeyFactory are implemented for SecretKey(struct .SecretKey.html), so any of the following work (note that hex strings and byte array are little-endian):
use tari_crypto::ristretto::RistrettoSecretKey; use tari_utilities::{ ByteArray, hex::Hex }; use tari_crypto::keys::SecretKey; use rand; let mut rng = rand::thread_rng(); let _k1 = RistrettoSecretKey::from_bytes(&[1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]); let _k2 = RistrettoSecretKey::from_hex(&"100000002000000030000000040000000"); let _k3 = RistrettoSecretKey::random(&mut rng);
Trait Implementations
impl<'a, 'b> Add<&'b RistrettoSecretKey> for &'a RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the +
operator.
fn add(self, rhs: &'b RistrettoSecretKey) -> RistrettoSecretKey
[src]
impl<'b> Add<&'b RistrettoSecretKey> for RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the +
operator.
fn add(self, rhs: &'b RistrettoSecretKey) -> RistrettoSecretKey
[src]
impl<'a> Add<RistrettoSecretKey> for &'a RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the +
operator.
fn add(self, rhs: RistrettoSecretKey) -> RistrettoSecretKey
[src]
impl Add<RistrettoSecretKey> for RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the +
operator.
fn add(self, rhs: RistrettoSecretKey) -> RistrettoSecretKey
[src]
impl ByteArray for RistrettoSecretKey
[src]
fn from_bytes(bytes: &[u8]) -> Result<RistrettoSecretKey, ByteArrayError> where
Self: Sized,
[src]
Self: Sized,
Create a secret key on the Ristretto255 curve using the given little-endian byte array. If the byte array is
not exactly 32 bytes long, from_bytes
returns an error. This function is guaranteed to return a valid key
in the group since it performs a mod l on the input.
fn as_bytes(&self) -> &[u8]
[src]
Return the byte array for the secret key in little-endian order
fn to_vec(&self) -> Vec<u8>
[src]
fn from_vec(v: &Vec<u8>) -> Result<Self, ByteArrayError>
[src]
impl Clone for RistrettoSecretKey
[src]
fn clone(&self) -> RistrettoSecretKey
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for RistrettoSecretKey
[src]
impl Default for RistrettoSecretKey
[src]
impl<'de> Deserialize<'de> for RistrettoSecretKey
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Drop for RistrettoSecretKey
[src]
Clear the secret key value in memory when it goes out of scope
impl Eq for RistrettoSecretKey
[src]
impl From<RistrettoSecretKey> for Scalar
[src]
fn from(k: RistrettoSecretKey) -> Self
[src]
impl From<u64> for RistrettoSecretKey
[src]
impl Hash for RistrettoSecretKey
[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<'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<'a, 'b> Mul<&'b RistrettoSecretKey> for &'a RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b RistrettoSecretKey) -> RistrettoSecretKey
[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<'b> Mul<&'b RistrettoSecretKey> for RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b RistrettoSecretKey) -> RistrettoSecretKey
[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<'a> Mul<RistrettoSecretKey> for &'a RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the *
operator.
fn mul(self, rhs: RistrettoSecretKey) -> RistrettoSecretKey
[src]
impl Mul<RistrettoSecretKey> for RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the *
operator.
fn mul(self, rhs: RistrettoSecretKey) -> RistrettoSecretKey
[src]
impl PartialEq<RistrettoSecretKey> for RistrettoSecretKey
[src]
impl SecretKey for RistrettoSecretKey
[src]
fn key_length() -> usize
[src]
fn random<R: Rng + CryptoRng>(rng: &mut R) -> Self
[src]
Return a random secret key on the ristretto255
curve using the supplied CSPRNG.
impl Serialize for RistrettoSecretKey
[src]
impl StructuralEq for RistrettoSecretKey
[src]
impl<'a, 'b> Sub<&'b RistrettoSecretKey> for &'a RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b RistrettoSecretKey) -> RistrettoSecretKey
[src]
impl<'b> Sub<&'b RistrettoSecretKey> for RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b RistrettoSecretKey) -> RistrettoSecretKey
[src]
impl<'a> Sub<RistrettoSecretKey> for &'a RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the -
operator.
fn sub(self, rhs: RistrettoSecretKey) -> RistrettoSecretKey
[src]
impl Sub<RistrettoSecretKey> for RistrettoSecretKey
[src]
type Output = RistrettoSecretKey
The resulting type after applying the -
operator.
fn sub(self, rhs: RistrettoSecretKey) -> RistrettoSecretKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for RistrettoSecretKey
impl Send for RistrettoSecretKey
impl Sync for RistrettoSecretKey
impl Unpin for RistrettoSecretKey
impl UnwindSafe for RistrettoSecretKey
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: Deserialize<'de>,
[src]
T: 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,
type T = T
fn from_hex(hex: &str) -> Result<<T as Hex>::T, HexError>
[src]
fn to_hex(&self) -> String
[src]
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, 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>,