pub trait PlainMessageSharedKeyCore {
    type R: RngSingleton;

    fn new(plain_message: Vec<u8>) -> Self
    where
        Self: Sized
; fn into_vec(self) -> Vec<u8>; fn as_slice(&self) -> &[u8]Notable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]; fn encrypt<S>(&self, shared_key: &S) -> Result<EncryptedMessage, Error>
    where
        S: AsSharedKey
, { ... } fn decrypt<S>(
        encrypted_message: &EncryptedMessage,
        shared_key: &S
    ) -> Result<Self, Error>
    where
        Self: Sized,
        S: AsSharedKey
, { ... } fn generate_nonce() -> XNonce { ... } }
Expand description

Plain message structure serialized via serde.

Required Associated Types

RNG singleton

Required Methods

Constructor

Raw representation

Ref to raw representation

Provided Methods

Encrypt into EncryptedMessage

Decrypt from EncryptedMessage

Generate random nonce which is large enough (24-byte) to rarely conflict.

Implementors