pub enum DecryptSemanticOutcome {
Success(Zeroizing<Vec<u8>>),
AuthenticationFailed,
}Expand description
Semantic result of an AEAD decrypt after parseable inputs were accepted.
This type is a closed enum: downstream crates cannot add variants. Use exhaustive
match (or if let) to branch; do not reduce verification to a secret-derived bool
without an explicit, reviewed threat model.
§Examples
use lib_q_core::{
AeadDecryptSemantic,
DecryptSemanticOutcome,
AeadKey,
Nonce,
};
match aead.decrypt_semantic(key, nonce, ct, None)? {
DecryptSemanticOutcome::Success(pt) => {
let _ = pt.len();
}
DecryptSemanticOutcome::AuthenticationFailed => {}
}Variants§
Success(Zeroizing<Vec<u8>>)
Verified plaintext; buffer is zeroized on drop.
AuthenticationFailed
Integrity failure after the algorithm’s decrypt/verify schedule. No plaintext.
Trait Implementations§
Source§impl Debug for DecryptSemanticOutcome
impl Debug for DecryptSemanticOutcome
Source§impl PartialEq for DecryptSemanticOutcome
impl PartialEq for DecryptSemanticOutcome
Source§fn eq(&self, other: &DecryptSemanticOutcome) -> bool
fn eq(&self, other: &DecryptSemanticOutcome) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for DecryptSemanticOutcome
impl StructuralPartialEq for DecryptSemanticOutcome
Auto Trait Implementations§
impl Freeze for DecryptSemanticOutcome
impl RefUnwindSafe for DecryptSemanticOutcome
impl Send for DecryptSemanticOutcome
impl Sync for DecryptSemanticOutcome
impl Unpin for DecryptSemanticOutcome
impl UnsafeUnpin for DecryptSemanticOutcome
impl UnwindSafe for DecryptSemanticOutcome
Blanket Implementations§
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