[][src]Trait nettle::mode::Mode

pub trait Mode {
    fn block_size(&self) -> usize;
fn encrypt(
        &mut self,
        iv: &mut [u8],
        dst: &mut [u8],
        src: &[u8]
    ) -> Result<()>;
fn decrypt(
        &mut self,
        iv: &mut [u8],
        dst: &mut [u8],
        src: &[u8]
    ) -> Result<()>; }

Block cipher mode of operation.

Block modes govern how a block cipher processes data spanning multiple blocks.

Required methods

fn block_size(&self) -> usize

Block size of the underlying cipher in bytes.

fn encrypt(&mut self, iv: &mut [u8], dst: &mut [u8], src: &[u8]) -> Result<()>

Encrypt a single block src using the initialization vector iv to a ciphertext block dst. Both iv and dstare updated. The bufferiv, dstandsrc` are expected to be at least as large as the block size of the underlying cipher.

fn decrypt(&mut self, iv: &mut [u8], dst: &mut [u8], src: &[u8]) -> Result<()>

Decrypt a single ciphertext block src using the initialization vector iv to a plaintext block dst. Both iv and dstare updated. The bufferiv, dstandsrc` are expected to be at least as large as the block size of the underlying cipher.

Loading content...

Implementors

impl<C: Cipher> Mode for Cbc<C>[src]

impl<C: Cipher> Mode for Cfb<C>[src]

impl<C: Cipher> Mode for Ctr<C>[src]

Loading content...