pub trait PlainMessagePublicKeyCore {
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(
&self,
combined_key: &SenderCombinedKey<'_, '_>
) -> Result<EncryptedMessage, Error> { ... }
fn decrypt(
encrypted_message: &EncryptedMessage,
combined_key: &ReceiverCombinedKey<'_, '_>
) -> Result<Self, Error>
where
Self: Sized,
{ ... }
fn generate_nonce() -> XNonce { ... }
}
Expand description
Plain message structure serialized via serde.
Required Associated Types
type R: RngSingleton
type R: RngSingleton
RNG singleton
Required Methods
Provided Methods
fn encrypt(
&self,
combined_key: &SenderCombinedKey<'_, '_>
) -> Result<EncryptedMessage, Error>
fn encrypt(
&self,
combined_key: &SenderCombinedKey<'_, '_>
) -> Result<EncryptedMessage, Error>
Encrypt into EncryptedMessage
fn decrypt(
encrypted_message: &EncryptedMessage,
combined_key: &ReceiverCombinedKey<'_, '_>
) -> Result<Self, Error> where
Self: Sized,
fn decrypt(
encrypted_message: &EncryptedMessage,
combined_key: &ReceiverCombinedKey<'_, '_>
) -> Result<Self, Error> where
Self: Sized,
Decrypt from EncryptedMessage
fn generate_nonce() -> XNonce
fn generate_nonce() -> XNonce
Generate random nonce which is large enough (24-byte) to rarely conflict.