[][src]Trait gost_modes::SyncStreamCipher

pub trait SyncStreamCipher {
    fn try_apply_keystream(&mut self, data: &mut [u8]) -> Result<(), LoopError>;

    fn apply_keystream(&mut self, data: &mut [u8]) { ... }
}

Synchronous stream cipher core trait.

Required methods

fn try_apply_keystream(&mut self, data: &mut [u8]) -> Result<(), LoopError>

Apply keystream to the data, but return an error if end of a keystream will be reached.

If end of the keystream will be achieved with the given data length, method will return Err(LoopError) without modifying provided data.

Loading content...

Provided methods

fn apply_keystream(&mut self, data: &mut [u8])

Apply keystream to the data.

It will XOR generated keystream with the data, which can be both encryption and decryption.

Panics

If end of the keystream will be reached with the given data length, method will panic without modifying the provided data.

Loading content...

Implementors

impl<C, M, S> SyncStreamCipher for GostCfb<C, M, S> where
    C: BlockCipher + NewBlockCipher,
    C::BlockSize: IsLessOrEqual<U255>,
    M: Unsigned + ArrayLength<u8> + IsGreaterOrEqual<C::BlockSize> + Sub<C::BlockSize>,
    S: Unsigned + IsGreater<U0> + IsLessOrEqual<C::BlockSize>,
    Diff<M, C::BlockSize>: ArrayLength<u8>, 
[src]

impl<C, S> SyncStreamCipher for GostCtr<C, S> where
    C: BlockCipher + NewBlockCipher,
    C::BlockSize: Div<U8> + Rem<U8> + Div<U2> + IsLessOrEqual<U255>,
    Mod<C::BlockSize, U8>: IsEqual<U0>,
    S: Unsigned + IsGreater<U0> + IsLessOrEqual<C::BlockSize>,
    Quot<C::BlockSize, U8>: ArrayLength<u64>,
    Quot<C::BlockSize, U2>: ArrayLength<u8>, 
[src]

impl<C, Z, S> SyncStreamCipher for GostOfb<C, Z, S> where
    C: BlockCipher + NewBlockCipher,
    C::BlockSize: IsLessOrEqual<U255>,
    S: Unsigned + IsGreater<U0> + IsLessOrEqual<C::BlockSize>,
    Z: ArrayLength<Block<C>> + Unsigned + Mul<C::BlockSize> + IsGreater<U0> + IsLessOrEqual<U255>,
    Prod<Z, C::BlockSize>: ArrayLength<u8>, 
[src]

Loading content...