BeRTOS
Functions
cipher.c File Reference

Generic interface for symmetric block ciphers. More...

#include "cipher.h"
#include <sec/util.h>

Go to the source code of this file.

Functions

void cipher_cbc_encrypt (BlockCipher *c, void *block)
 Encrypt a block (in-place) using the current key in CBC mode.
void cipher_cbc_decrypt (BlockCipher *c, void *block)
 Decrypt a block (in-place) using the current key in CBC mode.
void cipher_ctr_step (BlockCipher *c, void *block)
 Generate the crypted stream block in CTR mode for the current counter, and then bump it.
void cipher_ctr_encrypt (BlockCipher *c, void *block)
 Encrypt a block (in-place) using the current key in CTR mode.
void cipher_ctr_decrypt (BlockCipher *c, void *block)
 Decrypt a block (in-place) using the current key in CTR mode.
void cipher_ofb_encrypt (BlockCipher *c, void *block)
 Encrypt a block (in-place) using the current key in OFB mode.
void cipher_ofb_decrypt (BlockCipher *c, void *block)
 Decrypt a block (in-place) using the current key in OFB mode.

Detailed Description

Generic interface for symmetric block ciphers.

Author:
Giovanni Bajo <rasky@develer.com>

Definition in file cipher.c.


Function Documentation

void cipher_ctr_step ( BlockCipher *  c,
void *  block 
)

Generate the crypted stream block in CTR mode for the current counter, and then bump it.

This function is basically the core CTR operation, without the final XOR pass with the plaintext or ciphertext. For normal CTR usage, you never need to call it.

Definition at line 67 of file cipher.c.