Struct StreamingDecryptingKey
pub struct StreamingDecryptingKey { /* private fields */ }
Expand description
A key for streaming decryption operations.
Implementations§
§impl StreamingDecryptingKey
impl StreamingDecryptingKey
pub fn update<'a>(
&mut self,
input: &[u8],
output: &'a mut [u8],
) -> Result<BufferUpdate<'a>, Unspecified>
pub fn update<'a>( &mut self, input: &[u8], output: &'a mut [u8], ) -> Result<BufferUpdate<'a>, Unspecified>
Updates the internal state of the key with the provided ciphertext input
,
potentially also writing bytes of plaintext to output
.
The number of bytes written to output
can be up to input.len()
plus the block length of the cipher algorithm (e.g., Algorithm::block_len
).
§Errors
- Returns an error if the
output
buffer is smaller than the length of theinput
plus the algorithm’s block length. - May return an error if the length of
input
plus the algorithm’s block length is larger thani32::MAX
.
pub fn finish(self, output: &mut [u8]) -> Result<BufferUpdate<'_>, Unspecified>
pub fn finish(self, output: &mut [u8]) -> Result<BufferUpdate<'_>, Unspecified>
Finishes the decryption operation, writing the remaining plaintext to
output
.
The number of bytes written to output
can be up to the block length of
the cipher algorithm (e.g., Algorithm::block_len
).
§Errors
- Returns an error if the
output
buffer is smaller than the algorithm’s block length.
pub fn mode(&self) -> OperatingMode
pub fn mode(&self) -> OperatingMode
Returns the cipher operating mode.
pub fn ctr(
key: UnboundCipherKey,
context: DecryptionContext,
) -> Result<StreamingDecryptingKey, Unspecified>
pub fn ctr( key: UnboundCipherKey, context: DecryptionContext, ) -> Result<StreamingDecryptingKey, Unspecified>
Constructs a StreamingDecryptingKey
for decrypting using the CTR cipher mode.
The resulting plaintext will be the same length as the ciphertext.
§Errors
Returns an error on an internal failure.
pub fn cbc_pkcs7(
key: UnboundCipherKey,
context: DecryptionContext,
) -> Result<StreamingDecryptingKey, Unspecified>
pub fn cbc_pkcs7( key: UnboundCipherKey, context: DecryptionContext, ) -> Result<StreamingDecryptingKey, Unspecified>
Constructs a StreamingDecryptingKey
for decrypting using the CBC cipher mode.
The resulting plaintext will be shorter than the ciphertext.
§Errors
Returns an error on an internal failure.
pub fn cfb128(
key: UnboundCipherKey,
context: DecryptionContext,
) -> Result<StreamingDecryptingKey, Unspecified>
pub fn cfb128( key: UnboundCipherKey, context: DecryptionContext, ) -> Result<StreamingDecryptingKey, Unspecified>
The resulting plaintext will be the same length as the ciphertext.
§Errors
Returns an error on an internal failure.
pub fn ecb_pkcs7(
key: UnboundCipherKey,
context: DecryptionContext,
) -> Result<StreamingDecryptingKey, Unspecified>
pub fn ecb_pkcs7( key: UnboundCipherKey, context: DecryptionContext, ) -> Result<StreamingDecryptingKey, Unspecified>
Constructs a StreamingDecryptingKey
for decrypting using the ECB cipher mode.
The resulting plaintext will be the same length as the ciphertext.
§☠️ ️️️DANGER ☠️
Offered for computability purposes only. This is an extremely dangerous mode, and very likely not what you want to use.
§Errors
Returns an error on an internal failure.
Auto Trait Implementations§
impl Freeze for StreamingDecryptingKey
impl RefUnwindSafe for StreamingDecryptingKey
impl !Send for StreamingDecryptingKey
impl !Sync for StreamingDecryptingKey
impl Unpin for StreamingDecryptingKey
impl UnwindSafe for StreamingDecryptingKey
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more