Trait gost_modes::StreamCipherSeek[][src]

pub trait StreamCipherSeek {
    pub fn try_current_pos<T>(&self) -> Result<T, OverflowError>
    where
        T: SeekNum
;
pub fn try_seek<T>(&mut self, pos: T) -> Result<(), LoopError>
    where
        T: SeekNum
; pub fn current_pos<T>(&self) -> T
    where
        T: SeekNum
, { ... }
pub fn seek<T>(&mut self, pos: T)
    where
        T: SeekNum
, { ... } }

Trait for seekable stream ciphers.

Methods of this trait are generic over the SeekNum trait, which is implemented for primitive numeric types, i.e.: i/u8, i/u16, i/u32, i/u64, i/u128, and i/usize.

Required methods

pub fn try_current_pos<T>(&self) -> Result<T, OverflowError> where
    T: SeekNum
[src]

Try to get current keystream position

Returns LoopError if position can not be represented by type T

pub fn try_seek<T>(&mut self, pos: T) -> Result<(), LoopError> where
    T: SeekNum
[src]

Try to seek to the given position

Returns LoopError if provided position value is bigger than keystream length.

Loading content...

Provided methods

pub fn current_pos<T>(&self) -> T where
    T: SeekNum
[src]

Get current keystream position

Panics

If position can not be represented by type T

pub fn seek<T>(&mut self, pos: T) where
    T: SeekNum
[src]

Seek to the given position

Panics

If provided position value is bigger than keystream leangth

Loading content...

Implementors

impl<C, S> StreamCipherSeek for GostCtr64<C, S> where
    C: BlockCipher<BlockSize = U8> + BlockEncrypt + NewBlockCipher,
    C::ParBlocks: ArrayLength<GenericArray<u8, U8>>,
    S: ArrayLength<u8> + Unsigned + IsGreater<U0> + IsLessOrEqual<U8>, 
[src]

impl<C, S> StreamCipherSeek for GostCtr128<C, S> where
    C: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher,
    C::ParBlocks: ArrayLength<GenericArray<u8, U16>>,
    S: ArrayLength<u8> + Unsigned + IsGreater<U0> + IsLessOrEqual<U16>, 
[src]

Loading content...