Ciphers
Cryptographic Kernel

A generic cipher type enables cipher agility, that is, the ability to write code that runs with multiple cipher types. Ciphers can be used through the crypto kernel, or can be accessed directly, if need be. More...

## Functions

err_status_t | cipher_type_alloc (cipher_type_t *ctype, cipher_t **cipher, unsigned key_len)
| Allocates a cipher of a particular type.
err_status_t | cipher_init (cipher_t *cipher, const uint8_t *key)
| Initialized a cipher to use a particular key. May be invoked more than once on the same cipher.
err_status_t | cipher_set_iv (cipher_t *cipher, void *iv)
| Sets the initialization vector of a given cipher.
err_status_t | cipher_encrypt (cipher_t *cipher, void *buf, unsigned int *len)
| Encrypts a buffer with a given cipher.
err_status_t | cipher_output (cipher_t *c, uint8_t *buffer, int num_octets_to_output)
| Sets a buffer to the keystream generated by the cipher.
err_status_t | cipher_dealloc (cipher_t *cipher)
| Deallocates a cipher.

## Detailed Description

## Function Documentation

## cipher_dealloc()

err_status_t cipher_dealloc | ( | cipher_t * | cipher | ) |

Warning
  May be implemented as a macro.

## cipher_encrypt()

err_status_t cipher_encrypt | ( | cipher_t * | cipher,
|  | void * | buf,
|  | unsigned int * | len )

Warning
  May be implemented as a macro.

## cipher_init()

err_status_t cipher_init | ( | cipher_t * | cipher,
|  | const uint8_t * | key )

Warning
  May be implemented as a macro.

References key.

## cipher_output()

err_status_t cipher_output | ( | cipher_t * | c,
|  | uint8_t * | buffer,
|  | int | num_octets_to_output )

Warning
  May be implemented as a macro.

## cipher_set_iv()

err_status_t cipher_set_iv | ( | cipher_t * | cipher,
|  | void * | iv )

Warning
  May be implemented as a macro.

## cipher_type_alloc()

err_status_t cipher_type_alloc | ( | cipher_type_t * | ctype,
|  | cipher_t ** | cipher,
|  | unsigned | key_len )

Warning
  May be implemented as a macro.