[][src]Struct openpgp_dr::Ratchet

pub struct Ratchet<D: DH, R: KdfRK, C: KdfCK> { /* fields omitted */ }

A fully-initialized Double Ratchet.

Implementations

impl<D: DH, R: KdfRK, C: KdfCK> Ratchet<D, R, C>[src]

pub fn new(pre_key: PreKeyPair<D>, header: Header<D>) -> Result<(Self, Key)>[src]

Initializes the Double Ratchet and derives a message key for decryption.

pub fn encrypt(&mut self) -> Result<(Header<D>, Key)>[src]

Derives a message key for encryption.

pub fn decrypt(&mut self, header: Header<D>) -> Result<Key>[src]

Derives a message key for decryption.

Auto Trait Implementations

impl<D, R, C> RefUnwindSafe for Ratchet<D, R, C> where
    C: RefUnwindSafe,
    R: RefUnwindSafe,
    <D as DH>::Public: RefUnwindSafe,
    <D as DH>::Secret: RefUnwindSafe

impl<D, R, C> Send for Ratchet<D, R, C> where
    C: Send,
    R: Send,
    <D as DH>::Public: Send,
    <D as DH>::Secret: Send

impl<D, R, C> Sync for Ratchet<D, R, C> where
    C: Sync,
    R: Sync,
    <D as DH>::Public: Sync,
    <D as DH>::Secret: Sync

impl<D, R, C> Unpin for Ratchet<D, R, C> where
    C: Unpin,
    R: Unpin,
    <D as DH>::Public: Unpin,
    <D as DH>::Secret: Unpin

impl<D, R, C> UnwindSafe for Ratchet<D, R, C> where
    C: UnwindSafe,
    R: UnwindSafe,
    <D as DH>::Public: UnwindSafe,
    <D as DH>::Secret: UnwindSafe

Blanket Implementations

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

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

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

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

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

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.