[]Struct recrypt::api::PrivateKey

pub struct PrivateKey { /* fields omitted */ }

Methods

impl PrivateKey

pub const ENCODED_SIZE_BYTES: usize

pub fn bytes(&self) -> &[u8; 32]

pub fn new(bytes: [u8; 32]) -> PrivateKey

pub fn new_from_slice(bytes: &[u8]) -> Result<PrivateKey, RecryptErr>

construct $t from byte slice. Input slice must be exactly the correct length for the type.

Returns

Ok($t) or Err($RecryptErr::InputWrongSize]

pub fn augment_plus(&self, other: &PrivateKey) -> PrivateKey

Augment the private key with another. This function performs the addition in Fr, which matches the cycle of the elliptic curve. This allows augmented private keys to line up correctly with public keys generated from them.

pub fn augment_minus(&self, other: &PrivateKey) -> PrivateKey

Augment the private key with another. This function performs the subtraction in Fr, which matches the cycle of the elliptic curve. This allows augmented private keys to line up correctly with public keys generated from them.

Trait Implementations

impl Drop for PrivateKey

impl Clone for PrivateKey

impl Default for PrivateKey

impl Debug for PrivateKey

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized
[src]

impl<T> InitializableFromZeroed for T where
    T: Default
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self