pub struct DecryptingKey { /* private fields */ }
Expand description
A cipher decryption key that does not perform block padding.
Implementations§
Source§impl DecryptingKey
impl DecryptingKey
Sourcepub fn ctr(key: UnboundCipherKey) -> Result<DecryptingKey, Unspecified>
pub fn ctr(key: UnboundCipherKey) -> Result<DecryptingKey, Unspecified>
Constructs a cipher decrypting key operating in counter (CTR) mode using the provided key and context.
§Errors
Unspecified
: Returned if there is an error during decryption.
Sourcepub fn cfb128(key: UnboundCipherKey) -> Result<Self, Unspecified>
pub fn cfb128(key: UnboundCipherKey) -> Result<Self, Unspecified>
Constructs a cipher decrypting key operating in cipher feedback 128-bit mode (CFB128) using the provided key and context.
§Errors
Unspecified
: Returned if there is an error during decryption.
Sourcepub fn ecb(key: UnboundCipherKey) -> Result<Self, Unspecified>
pub fn ecb(key: UnboundCipherKey) -> Result<Self, Unspecified>
Constructs an DecryptingKey
operating in electronic code book (ECB) mode using the provided key.
§☠️ ️️️DANGER ☠️
Offered for computability purposes only. This is an extremely dangerous mode, and very likely not what you want to use.
§Errors
Unspecified
: Returned if there is an error constructing theDecryptingKey
.
Sourcepub fn mode(&self) -> OperatingMode
pub fn mode(&self) -> OperatingMode
Returns the cipher operating mode.
Sourcepub fn decrypt<'in_out>(
&self,
in_out: &'in_out mut [u8],
context: DecryptionContext,
) -> Result<&'in_out mut [u8], Unspecified>
pub fn decrypt<'in_out>( &self, in_out: &'in_out mut [u8], context: DecryptionContext, ) -> Result<&'in_out mut [u8], Unspecified>
Decrypts the data provided in in_out
in-place.
Returns a references to the decrypted data.
If DecryptingKey
is operating in OperatingMode::ECB
, then in_out.len()
must be a multiple
of the block length.
§Errors
Unspecified
: Returned if cipher mode requires input to be a multiple of the block length, andin_out.len()
is not. Also returned if decryption fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DecryptingKey
impl RefUnwindSafe for DecryptingKey
impl Send for DecryptingKey
impl Sync for DecryptingKey
impl Unpin for DecryptingKey
impl UnwindSafe for DecryptingKey
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