BeeCrypt 4.2.1
aes.h File Reference

AES block cipher, as specified by NIST FIPS 197. More...

#include "beecrypt/beecrypt.h"
#include "beecrypt/aesopt.h"
Include dependency graph for aes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  aesParam
 Holds all the parameters necessary for the AES cipher. More...
 

Functions

BEECRYPTAPI int aesSetup (aesParam *ap, const byte *key, size_t keybits, cipherOperation op)
 This function performs the cipher's key expansion.
 
BEECRYPTAPI int aesSetIV (aesParam *ap, const byte *iv)
 This function sets the Initialization Vector.
 
BEECRYPTAPI int aesSetCTR (aesParam *ap, const byte *nivz, size_t counter)
 This function sets the CTR mode counter.
 
BEECRYPTAPI int aesEncrypt (aesParam *ap, uint32_t *dst, const uint32_t *src)
 This function performs the raw AES encryption; it encrypts one block of 128 bits.
 
BEECRYPTAPI int aesDecrypt (aesParam *ap, uint32_t *dst, const uint32_t *src)
 This function performs the raw AES decryption; it decrypts one block of 128 bits.
 
BEECRYPTAPI uint32_t * aesFeedback (aesParam *ap)
 

Variables

const BEECRYPTAPI blockCipher aes
 Holds the full API description of the AES algorithm.
 

Detailed Description

AES block cipher, as specified by NIST FIPS 197.

Author
Bob Deblier bob.d.nosp@m.ebli.nosp@m.er@te.nosp@m.lene.nosp@m.t.be

Function Documentation

◆ aesDecrypt()

BEECRYPTAPI int aesDecrypt ( aesParam * ap,
uint32_t * dst,
const uint32_t * src )

This function performs the raw AES decryption; it decrypts one block of 128 bits.

Parameters
apThe cipher's parameter block.
dstThe cleartext; should be aligned on 32-bit boundary.
srcThe ciphertext; should be aligned on 32-bit boundary.
Return values
0on success.

References BEECRYPTAPI.

◆ aesEncrypt()

BEECRYPTAPI int aesEncrypt ( aesParam * ap,
uint32_t * dst,
const uint32_t * src )

This function performs the raw AES encryption; it encrypts one block of 128 bits.

Parameters
apThe cipher's parameter block.
dstThe ciphertext; should be aligned on 32-bit boundary.
srcThe cleartext; should be aligned on 32-bit boundary.
Return values
0on success.

References BEECRYPTAPI.

◆ aesFeedback()

BEECRYPTAPI uint32_t * aesFeedback ( aesParam * ap)

◆ aesSetCTR()

BEECRYPTAPI int aesSetCTR ( aesParam * ap,
const byte * nivz,
size_t counter )

This function sets the CTR mode counter.

Note
This function is only useful in CTR modes.
Parameters
apThe cipher's parameter block.
nivzThe concatenation of Nonce, IV, and padding Zeroes.
counterThe counter.
Return values
0on success.

References BEECRYPTAPI.

◆ aesSetIV()

BEECRYPTAPI int aesSetIV ( aesParam * ap,
const byte * iv )

This function sets the Initialization Vector.

Note
This function is only useful in block chaining or feedback modes.
Parameters
apThe cipher's parameter block.
ivThe initialization vector; may be null.
Return values
0on success.

References BEECRYPTAPI.

◆ aesSetup()

BEECRYPTAPI int aesSetup ( aesParam * ap,
const byte * key,
size_t keybits,
cipherOperation op )

This function performs the cipher's key expansion.

Parameters
apThe cipher's parameter block.
keyThe key value.
keybitsThe number of bits in the key; legal values are: 128, 192 and 256.
opENCRYPT or DECRYPT.
Return values
0on success.
-1on failure.

References BEECRYPTAPI.

Variable Documentation

◆ aes

const BEECRYPTAPI blockCipher aes
extern

Holds the full API description of the AES algorithm.