aes_modes.c File Reference
`#include <string.h>`
`#include <assert.h>`
`#include <stdint.h>`
`#include "aesopt.h"`

## Macros

#define | BFR_BLOCKS 8
#define | FAST_BUFFER_OPERATIONS
#define | lp32(x) ((uint32_t*)(x))
#define | aligned_array(type, name, no, stride) type name[no]
#define | aligned_auto(type, name, no, stride) type name[no]
#define | via_cwd(cwd, ty, dir, len)
#define | BFR_LENGTH (BFR_BLOCKS * AES_BLOCK_SIZE)

## Functions

AES_RETURN | aes_test_alignment_detection (unsigned int n)
AES_RETURN | aes_mode_reset (aes_encrypt_ctx ctx[1])
AES_RETURN | aes_ecb_encrypt (const unsigned char *ibuf, unsigned char *obuf, int len, const aes_encrypt_ctx ctx[1])
AES_RETURN | aes_ecb_decrypt (const unsigned char *ibuf, unsigned char *obuf, int len, const aes_decrypt_ctx ctx[1])
AES_RETURN | aes_cbc_encrypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *iv, const aes_encrypt_ctx ctx[1])
AES_RETURN | aes_cbc_decrypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *iv, const aes_decrypt_ctx ctx[1])
AES_RETURN | aes_cfb_encrypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *iv, aes_encrypt_ctx ctx[1])
AES_RETURN | aes_cfb_decrypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *iv, aes_encrypt_ctx ctx[1])
AES_RETURN | aes_ofb_crypt (const unsigned char *ibuf, unsigned char *obuf, int len, unsigned char *iv, aes_encrypt_ctx ctx[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 ctx[1])

## Macro Definition Documentation

## aligned_array

#define aligned_array | ( |  | type,
|  |  | name,
|  |  | no,
|  |  | stride
| ) |  | type name[no]

## aligned_auto

#define aligned_auto | ( |  | type,
|  |  | name,
|  |  | no,
|  |  | stride
| ) |  | type name[no]

## BFR_BLOCKS

#define BFR_BLOCKS 8

## BFR_LENGTH

#define BFR_LENGTH (BFR_BLOCKS * AES_BLOCK_SIZE)

## FAST_BUFFER_OPERATIONS

#define FAST_BUFFER_OPERATIONS

## lp32

#define lp32 | ( |  | x | ) | ((uint32_t*)(x))

## via_cwd

#define via_cwd | ( |  | cwd,
|  |  | ty,
|  |  | dir,
|  |  | len
| ) |  |

Value:
aligned_auto(unsigned long, cwd, 4, 16); \
cwd[1] = cwd[2] = cwd[3] = 0; \
cwd[0] = neh_##dir##_##ty##_key(len)
aligned_auto
#define aligned_auto(type, name, no, stride)
Definition: aes_modes.c:89

## 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 | ctx[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 | ctx[1]
| ) |  |

## aes_cfb_decrypt()

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

## aes_cfb_encrypt()

AES_RETURN aes_cfb_encrypt | ( | const unsigned char * | ibuf,
|  | unsigned char * | obuf,
|  | int | len,
|  | unsigned char * | iv,
|  | aes_encrypt_ctx | ctx[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 | ctx[1]
| ) |  |

## aes_ecb_decrypt()

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

## aes_ecb_encrypt()

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

## aes_mode_reset()

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

## aes_ofb_crypt()

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

## aes_test_alignment_detection()

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