Struct cosmian_crypto_core::R25519PrivateKey
source · pub struct R25519PrivateKey(/* private fields */);
Implementations§
source§impl R25519PrivateKey
impl R25519PrivateKey
Facades
Facades are used to hide the underlying types and provide a more user friendly interface to the user.
sourcepub fn new<R: CryptoRngCore>(rng: &mut R) -> Self
pub fn new<R: CryptoRngCore>(rng: &mut R) -> Self
Generate a random private key
This is a facade to RandomFixedSizeCBytes::new
sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Get the underlying bytes slice of the private key
This is a facade to RandomFixedSizeCBytes::as_bytes
sourcepub fn to_bytes(&self) -> [u8; 32]
pub fn to_bytes(&self) -> [u8; 32]
Serialize the PrivateKey
as a non zero scalar
This is a facade to <Self as FixedSizeCBytes>::to_bytes
sourcepub fn try_from_bytes(bytes: [u8; 32]) -> Result<Self, CryptoCoreError>
pub fn try_from_bytes(bytes: [u8; 32]) -> Result<Self, CryptoCoreError>
Deserialize the PrivateKey
from a non zero scalar
This is a facade to <Self as FixedSizeCBytes<R25519_PRIVATE_KEY_LENGTH>>::try_from_bytes
Trait Implementations§
source§impl<'a> Add<&'a R25519PrivateKey> for &R25519PrivateKey
impl<'a> Add<&'a R25519PrivateKey> for &R25519PrivateKey
§type Output = R25519PrivateKey
type Output = R25519PrivateKey
The resulting type after applying the
+
operator.source§impl Clone for R25519PrivateKey
impl Clone for R25519PrivateKey
source§fn clone(&self) -> R25519PrivateKey
fn clone(&self) -> R25519PrivateKey
Returns a copy 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 R25519PrivateKey
impl Debug for R25519PrivateKey
source§impl<'a> Div<&'a R25519PrivateKey> for &R25519PrivateKey
impl<'a> Div<&'a R25519PrivateKey> for &R25519PrivateKey
§type Output = R25519PrivateKey
type Output = R25519PrivateKey
The resulting type after applying the
/
operator.source§impl Drop for R25519PrivateKey
impl Drop for R25519PrivateKey
source§impl EciesEcPrivateKey<R25519_PRIVATE_KEY_LENGTH> for R25519PrivateKey
impl EciesEcPrivateKey<R25519_PRIVATE_KEY_LENGTH> for R25519PrivateKey
fn new<R: CryptoRngCore>(rng: &mut R) -> Self
source§impl FixedSizeCBytes<{ R25519_PRIVATE_KEY_LENGTH }> for R25519PrivateKey
impl FixedSizeCBytes<{ R25519_PRIVATE_KEY_LENGTH }> for R25519PrivateKey
source§fn try_from_bytes(bytes: [u8; 32]) -> Result<Self, CryptoCoreError>
fn try_from_bytes(bytes: [u8; 32]) -> Result<Self, CryptoCoreError>
Tries to create a key from the given array of bytes into a key.
source§fn try_from_slice(slice: &[u8]) -> Result<Self, CryptoCoreError>
fn try_from_slice(slice: &[u8]) -> Result<Self, CryptoCoreError>
Tries to create a key from the given slice of bytes into a key.
source§impl From<&R25519PrivateKey> for R25519CurvePoint
impl From<&R25519PrivateKey> for R25519CurvePoint
source§fn from(private_key: &R25519PrivateKey) -> Self
fn from(private_key: &R25519PrivateKey) -> Self
Converts to this type from the input type.
source§impl From<R25519PrivateKey> for R25519CurvePoint
impl From<R25519PrivateKey> for R25519CurvePoint
source§fn from(private_key: R25519PrivateKey) -> Self
fn from(private_key: R25519PrivateKey) -> Self
Converts to this type from the input type.
source§impl Hash for R25519PrivateKey
impl Hash for R25519PrivateKey
source§impl<'a> Mul<&'a R25519PrivateKey> for &R25519CurvePoint
impl<'a> Mul<&'a R25519PrivateKey> for &R25519CurvePoint
§type Output = R25519CurvePoint
type Output = R25519CurvePoint
The resulting type after applying the
*
operator.source§impl<'a> Mul<&'a R25519PrivateKey> for &R25519PrivateKey
impl<'a> Mul<&'a R25519PrivateKey> for &R25519PrivateKey
§type Output = R25519PrivateKey
type Output = R25519PrivateKey
The resulting type after applying the
*
operator.source§impl PartialEq for R25519PrivateKey
impl PartialEq for R25519PrivateKey
source§fn eq(&self, other: &R25519PrivateKey) -> bool
fn eq(&self, other: &R25519PrivateKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RandomFixedSizeCBytes<{ R25519_PRIVATE_KEY_LENGTH }> for R25519PrivateKey
impl RandomFixedSizeCBytes<{ R25519_PRIVATE_KEY_LENGTH }> for R25519PrivateKey
source§impl Serializable for R25519PrivateKey
impl Serializable for R25519PrivateKey
Key Serialization framework
§type Error = CryptoCoreError
type Error = CryptoCoreError
Error type returned by the serialization.
source§fn length(&self) -> usize
fn length(&self) -> usize
Retrieves the length of the serialized object if it can be known. Read more
source§fn write(&self, ser: &mut Serializer) -> Result<usize, Self::Error>
fn write(&self, ser: &mut Serializer) -> Result<usize, Self::Error>
Writes to the given
Serializer
.source§fn read(de: &mut Deserializer<'_>) -> Result<Self, Self::Error>
fn read(de: &mut Deserializer<'_>) -> Result<Self, Self::Error>
Reads from the given
Deserializer
.source§impl<'a> Sub<&'a R25519PrivateKey> for &R25519PrivateKey
impl<'a> Sub<&'a R25519PrivateKey> for &R25519PrivateKey
§type Output = R25519PrivateKey
type Output = R25519PrivateKey
The resulting type after applying the
-
operator.source§impl Zeroize for R25519PrivateKey
impl Zeroize for R25519PrivateKey
impl CBytes for R25519PrivateKey
impl Eq for R25519PrivateKey
impl SecretCBytes<{ R25519_PRIVATE_KEY_LENGTH }> for R25519PrivateKey
impl StructuralPartialEq for R25519PrivateKey
Auto Trait Implementations§
impl Freeze for R25519PrivateKey
impl RefUnwindSafe for R25519PrivateKey
impl Send for R25519PrivateKey
impl Sync for R25519PrivateKey
impl Unpin for R25519PrivateKey
impl UnwindSafe for R25519PrivateKey
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)