Struct tari_crypto::ristretto::ristretto_keys::RistrettoSecretKey [−][src]
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
pub fn to_vec(&self) -> Vec<u8, Global>
[src]
pub fn from_vec(v: &Vec<u8, Global>) -> Result<Self, ByteArrayError>
[src]
impl Clone for RistrettoSecretKey
[src]
fn clone(&self) -> RistrettoSecretKey
[src]
pub 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<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
pub 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,
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> Hex for T where
T: ByteArray,
[src]
T: ByteArray,
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>,