pub struct Ctr<B, F>where
B: BlockEncrypt,
F: CtrFlavor<B::BlockSize>,{ /* private fields */ }
Expand description
Generic CTR block mode isntance.
Implementations§
source§impl<B, F> Ctr<B, F>where
B: BlockEncrypt,
F: CtrFlavor<B::BlockSize>,
impl<B, F> Ctr<B, F>where B: BlockEncrypt, F: CtrFlavor<B::BlockSize>,
sourcepub fn seek_block(&mut self, block: F::Backend)
pub fn seek_block(&mut self, block: F::Backend)
Seek to the given block
sourcepub fn current_block(&self) -> F::Backend
pub fn current_block(&self) -> F::Backend
Return number of the current block
Trait Implementations§
source§impl<B, F> Clone for Ctr<B, F>where
B: BlockEncrypt + Clone,
F: CtrFlavor<B::BlockSize> + Clone,
B::BlockSize: Clone,
impl<B, F> Clone for Ctr<B, F>where B: BlockEncrypt + Clone, F: CtrFlavor<B::BlockSize> + Clone, B::BlockSize: Clone,
source§impl<B, F> Debug for Ctr<B, F>where
B: BlockEncrypt + Debug,
F: CtrFlavor<B::BlockSize> + Debug,
impl<B, F> Debug for Ctr<B, F>where B: BlockEncrypt + Debug, F: CtrFlavor<B::BlockSize> + Debug,
source§impl<B, F> FromBlockCipher for Ctr<B, F>where
B: BlockEncrypt,
F: CtrFlavor<B::BlockSize>,
impl<B, F> FromBlockCipher for Ctr<B, F>where B: BlockEncrypt, F: CtrFlavor<B::BlockSize>,
§type BlockCipher = B
type BlockCipher = B
Block cipher
§type NonceSize = <B as BlockCipher>::BlockSize
type NonceSize = <B as BlockCipher>::BlockSize
Nonce size in bytes
source§fn from_block_cipher(cipher: B, nonce: &Block<B>) -> Self
fn from_block_cipher(cipher: B, nonce: &Block<B>) -> Self
Instantiate a stream cipher from a block cipher
source§impl<B, F> StreamCipher for Ctr<B, F>where
B: BlockEncrypt,
F: CtrFlavor<B::BlockSize>,
impl<B, F> StreamCipher for Ctr<B, F>where B: BlockEncrypt, F: CtrFlavor<B::BlockSize>,
source§impl<B, F> StreamCipherSeek for Ctr<B, F>where
B: BlockEncrypt,
F: CtrFlavor<B::BlockSize>,
impl<B, F> StreamCipherSeek for Ctr<B, F>where B: BlockEncrypt, F: CtrFlavor<B::BlockSize>,
source§fn try_current_pos<T: SeekNum>(&self) -> Result<T, OverflowError>
fn try_current_pos<T: SeekNum>(&self) -> Result<T, OverflowError>
Try to get current keystream position Read more
source§fn try_seek<S: SeekNum>(&mut self, pos: S) -> Result<(), LoopError>
fn try_seek<S: SeekNum>(&mut self, pos: S) -> Result<(), LoopError>
Try to seek to the given position Read more
source§fn current_pos<T>(&self) -> Twhere
T: SeekNum,
fn current_pos<T>(&self) -> Twhere T: SeekNum,
Get current keystream position Read more
Auto Trait Implementations§
impl<B, F> RefUnwindSafe for Ctr<B, F>where B: RefUnwindSafe, F: RefUnwindSafe, <<B as BlockCipher>::BlockSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe, <F as CtrFlavor<<B as BlockCipher>::BlockSize>>::Nonce: RefUnwindSafe,
impl<B, F> Send for Ctr<B, F>where B: Send, F: Send, <F as CtrFlavor<<B as BlockCipher>::BlockSize>>::Nonce: Send,
impl<B, F> Sync for Ctr<B, F>where B: Sync, F: Sync, <F as CtrFlavor<<B as BlockCipher>::BlockSize>>::Nonce: Sync,
impl<B, F> Unpin for Ctr<B, F>where B: Unpin, F: Unpin, <<B as BlockCipher>::BlockSize as ArrayLength<u8>>::ArrayType: Unpin, <F as CtrFlavor<<B as BlockCipher>::BlockSize>>::Nonce: Unpin,
impl<B, F> UnwindSafe for Ctr<B, F>where B: UnwindSafe, F: UnwindSafe, <<B as BlockCipher>::BlockSize as ArrayLength<u8>>::ArrayType: UnwindSafe, <F as CtrFlavor<<B as BlockCipher>::BlockSize>>::Nonce: UnwindSafe,
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