aes.h File Reference
`#include <stdlib.h>`
`#include "brg_types.h"`

Go to the source code of this file.

## Classes

union | aes_inf
struct | aes_encrypt_ctx
struct | aes_decrypt_ctx

## Macros

#define | AES_128 /* if a fast 128 bit key scheduler is needed */
#define | AES_192 /* if a fast 192 bit key scheduler is needed */
#define | AES_256 /* if a fast 256 bit key scheduler is needed */
#define | AES_VAR /* if variable key size scheduler is needed */
#define | AES_MODES /* if support is needed for modes */
#define | AES_ENCRYPT /* if support for encryption is needed */
#define | AES_DECRYPT /* if support for decryption is needed */
#define | AES_BLOCK_SIZE 16 /* the AES block size in bytes */
#define | N_COLS 4 /* the number of columns in the state */
#define | KS_LENGTH 60
#define | AES_RETURN INT_RETURN
#define | aes_ofb_encrypt aes_ofb_crypt
#define | aes_ofb_decrypt aes_ofb_crypt
#define | aes_ctr_encrypt aes_ctr_crypt
#define | aes_ctr_decrypt aes_ctr_crypt

## Typedefs

typedef void | cbuf_inc(unsigned char *cbuf)

## Functions

AES_RETURN | aes_init (void)
AES_RETURN | aes_encrypt_key128 (const unsigned char *key, aes_encrypt_ctx cx[1])
AES_RETURN | aes_encrypt_key192 (const unsigned char *key, aes_encrypt_ctx cx[1])
AES_RETURN | aes_encrypt_key256 (const unsigned char *key, aes_encrypt_ctx cx[1])
AES_RETURN | aes_encrypt_key (const unsigned char *key, int key_len, aes_encrypt_ctx cx[1])
AES_RETURN | aes_encrypt (const unsigned char *in, unsigned char *out, const aes_encrypt_ctx cx[1])
AES_RETURN | aes_decrypt_key128 (const unsigned char *key, aes_decrypt_ctx cx[1])
AES_RETURN | aes_decrypt_key192 (const unsigned char *key, aes_decrypt_ctx cx[1])
AES_RETURN | aes_decrypt_key256 (const unsigned char *key, aes_decrypt_ctx cx[1])
AES_RETURN | aes_decrypt_key (const unsigned char *key, int key_len, aes_decrypt_ctx cx[1])
AES_RETURN | aes_decrypt (const unsigned char *in, unsigned char *out, const aes_decrypt_ctx cx[1])
AES_RETURN | aes_test_alignment_detection (unsigned int n)
AES_RETURN | aes_ecb_encrypt (const unsigned char *ibuf, unsigned char *obuf, int len, const aes_encrypt_ctx cx[1])
AES_RETURN | aes_ecb_decrypt (const unsigned char *ibuf, unsigned char *obuf, int len, const aes_decrypt_ctx cx[1])
AES_RETURN | aes_cbc_encrypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *iv, const aes_encrypt_ctx cx[1])
AES_RETURN | aes_cbc_decrypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *iv, const aes_decrypt_ctx cx[1])
AES_RETURN | aes_mode_reset (aes_encrypt_ctx cx[1])
AES_RETURN | aes_cfb_encrypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *iv, aes_encrypt_ctx cx[1])
AES_RETURN | aes_cfb_decrypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *iv, aes_encrypt_ctx cx[1])
AES_RETURN | aes_ofb_crypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *iv, aes_encrypt_ctx cx[1])
AES_RETURN | aes_ctr_crypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *cbuf, cbuf_inc ctr_inc, aes_encrypt_ctx cx[1])

## Macro Definition Documentation

## AES_128

#define AES_128 /* if a fast 128 bit key scheduler is needed */

## AES_192

#define AES_192 /* if a fast 192 bit key scheduler is needed */

## AES_256

#define AES_256 /* if a fast 256 bit key scheduler is needed */

## AES_BLOCK_SIZE

#define AES_BLOCK_SIZE 16 /* the AES block size in bytes */

## aes_ctr_decrypt

#define aes_ctr_decrypt aes_ctr_crypt

## aes_ctr_encrypt

#define aes_ctr_encrypt aes_ctr_crypt

## AES_DECRYPT

#define AES_DECRYPT /* if support for decryption is needed */

## AES_ENCRYPT

#define AES_ENCRYPT /* if support for encryption is needed */

## AES_MODES

#define AES_MODES /* if support is needed for modes */

## aes_ofb_decrypt

#define aes_ofb_decrypt aes_ofb_crypt

## aes_ofb_encrypt

#define aes_ofb_encrypt aes_ofb_crypt

## AES_RETURN

#define AES_RETURN INT_RETURN

## AES_VAR

#define AES_VAR /* if variable key size scheduler is needed */

## KS_LENGTH

#define KS_LENGTH 60

## N_COLS

#define N_COLS 4 /* the number of columns in the state */

## Typedef Documentation

## cbuf_inc

typedef void cbuf_inc(unsigned char *cbuf)

## Function Documentation

## aes_cbc_decrypt()

AES_RETURN aes_cbc_decrypt | ( | const unsigned char * | ibuf,
|  | unsigned char * | obuf,
|  | int | len,
|  | unsigned char * | iv,
|  | const aes_decrypt_ctx | cx[1]
| ) |  |

## aes_cbc_encrypt()

AES_RETURN aes_cbc_encrypt | ( | const unsigned char * | ibuf,
|  | unsigned char * | obuf,
|  | int | len,
|  | unsigned char * | iv,
|  | const aes_encrypt_ctx | cx[1]
| ) |  |

## aes_cfb_decrypt()

AES_RETURN aes_cfb_decrypt | ( | const unsigned char * | ibuf,
|  | unsigned char * | obuf,
|  | int | len,
|  | unsigned char * | iv,
|  | aes_encrypt_ctx | cx[1]
| ) |  |

## aes_cfb_encrypt()

AES_RETURN aes_cfb_encrypt | ( | const unsigned char * | ibuf,
|  | unsigned char * | obuf,
|  | int | len,
|  | unsigned char * | iv,
|  | aes_encrypt_ctx | cx[1]
| ) |  |

## aes_ctr_crypt()

AES_RETURN aes_ctr_crypt | ( | const unsigned char * | ibuf,
|  | unsigned char * | obuf,
|  | int | len,
|  | unsigned char * | cbuf,
|  | cbuf_inc | ctr_inc,
|  | aes_encrypt_ctx | cx[1]
| ) |  |

## aes_decrypt()

AES_RETURN aes_decrypt | ( | const unsigned char * | in,
|  | unsigned char * | out,
|  | const aes_decrypt_ctx | cx[1]
| ) |  |

## aes_decrypt_key()

AES_RETURN aes_decrypt_key | ( | const unsigned char * | key,
|  | int | key_len,
|  | aes_decrypt_ctx | cx[1]
| ) |  |

## aes_decrypt_key128()

AES_RETURN aes_decrypt_key128 | ( | const unsigned char * | key,
|  | aes_decrypt_ctx | cx[1]
| ) |  |

## aes_decrypt_key192()

AES_RETURN aes_decrypt_key192 | ( | const unsigned char * | key,
|  | aes_decrypt_ctx | cx[1]
| ) |  |

## aes_decrypt_key256()

AES_RETURN aes_decrypt_key256 | ( | const unsigned char * | key,
|  | aes_decrypt_ctx | cx[1]
| ) |  |

## aes_ecb_decrypt()

AES_RETURN aes_ecb_decrypt | ( | const unsigned char * | ibuf,
|  | unsigned char * | obuf,
|  | int | len,
|  | const aes_decrypt_ctx | cx[1]
| ) |  |

## aes_ecb_encrypt()

AES_RETURN aes_ecb_encrypt | ( | const unsigned char * | ibuf,
|  | unsigned char * | obuf,
|  | int | len,
|  | const aes_encrypt_ctx | cx[1]
| ) |  |

## aes_encrypt()

AES_RETURN aes_encrypt | ( | const unsigned char * | in,
|  | unsigned char * | out,
|  | const aes_encrypt_ctx | cx[1]
| ) |  |

## aes_encrypt_key()

AES_RETURN aes_encrypt_key | ( | const unsigned char * | key,
|  | int | key_len,
|  | aes_encrypt_ctx | cx[1]
| ) |  |

## aes_encrypt_key128()

AES_RETURN aes_encrypt_key128 | ( | const unsigned char * | key,
|  | aes_encrypt_ctx | cx[1]
| ) |  |

## aes_encrypt_key192()

AES_RETURN aes_encrypt_key192 | ( | const unsigned char * | key,
|  | aes_encrypt_ctx | cx[1]
| ) |  |

## aes_encrypt_key256()

AES_RETURN aes_encrypt_key256 | ( | const unsigned char * | key,
|  | aes_encrypt_ctx | cx[1]
| ) |  |

## aes_init()

AES_RETURN aes_init | ( | void |  | ) |

## aes_mode_reset()

AES_RETURN aes_mode_reset | ( | aes_encrypt_ctx | cx[1] | ) |

## aes_ofb_crypt()

AES_RETURN aes_ofb_crypt | ( | const unsigned char * | ibuf,
|  | unsigned char * | obuf,
|  | int | len,
|  | unsigned char * | iv,
|  | aes_encrypt_ctx | cx[1]
| ) |  |

## aes_test_alignment_detection()

AES_RETURN aes_test_alignment_detection | ( | unsigned int | n | ) |