pub struct MlDsaSelfEncryptedContent {
pub ciphertext: Vec<u8>,
pub nonce: [u8; 12],
}Expand description
ML-DSA-derived ChaCha20-Poly1305 encrypted content Simple self-encryption using only the sender’s ML-DSA keypair derived from mnemonic Only the sender can decrypt this content (encrypt-to-self pattern) Public key is available from message sender field - no need to duplicate
Fields§
§ciphertext: Vec<u8>Encrypted data + authentication tag
nonce: [u8; 12]ChaCha20-Poly1305 nonce (12 bytes)
Implementations§
Source§impl MlDsaSelfEncryptedContent
impl MlDsaSelfEncryptedContent
Sourcepub fn encrypt(
plaintext: &[u8],
signing_key: &MLDSA65SigningKey,
) -> Result<Self, CryptoError>
pub fn encrypt( plaintext: &[u8], signing_key: &MLDSA65SigningKey, ) -> Result<Self, CryptoError>
Encrypt data using ML-DSA private key (self-encryption) Derives a ChaCha20 key from the ML-DSA private key deterministically Only the same private key can decrypt this content
Trait Implementations§
Source§impl Clone for MlDsaSelfEncryptedContent
impl Clone for MlDsaSelfEncryptedContent
Source§fn clone(&self) -> MlDsaSelfEncryptedContent
fn clone(&self) -> MlDsaSelfEncryptedContent
Returns a duplicate 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 MlDsaSelfEncryptedContent
impl Debug for MlDsaSelfEncryptedContent
Source§impl<'de> Deserialize<'de> for MlDsaSelfEncryptedContent
impl<'de> Deserialize<'de> for MlDsaSelfEncryptedContent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MlDsaSelfEncryptedContent
impl StructuralPartialEq for MlDsaSelfEncryptedContent
Auto Trait Implementations§
impl Freeze for MlDsaSelfEncryptedContent
impl RefUnwindSafe for MlDsaSelfEncryptedContent
impl Send for MlDsaSelfEncryptedContent
impl Sync for MlDsaSelfEncryptedContent
impl Unpin for MlDsaSelfEncryptedContent
impl UnwindSafe for MlDsaSelfEncryptedContent
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more