OpenSSL  1.0.1c
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Macros | Functions | Variables
e_aes.c File Reference
#include <openssl/opensslconf.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <string.h>
#include <assert.h>
#include <openssl/aes.h>
#include "evp_locl.h"
#include "modes_lcl.h"
#include <openssl/rand.h>

Go to the source code of this file.

Classes

struct  EVP_AES_KEY
 
struct  EVP_AES_GCM_CTX
 
struct  EVP_AES_XTS_CTX
 
struct  EVP_AES_CCM_CTX
 

Macros

#define MAXBITCHUNK   ((size_t)1<<(sizeof(size_t)*8-4))
 
#define BLOCK_CIPHER_generic(nid, keylen, blocksize, ivlen, nmode, mode, MODE, flags)
 
#define BLOCK_CIPHER_custom(nid, keylen, blocksize, ivlen, mode, MODE, flags)
 
#define BLOCK_CIPHER_generic_pack(nid, keylen, flags)
 
#define CUSTOM_FLAGS
 
#define aes_xts_cleanup   NULL
 
#define XTS_FLAGS
 
#define aes_ccm_cleanup   NULL
 

Functions

 BLOCK_CIPHER_generic_pack (BLOCK_CIPHER_generic_pack(NID_aes, 128, EVP_CIPH_FLAG_FIPS)
 
 BLOCK_CIPHER_custom (NID_aes, 128, 1, 12, gcm, GCM, EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_AEAD_CIPHER|CUSTOM_FLAGS) BLOCK_CIPHER_custom(NID_aes
 
EVP_CIPH_FLAG_FIPS
EVP_CIPH_FLAG_AEAD_CIPHER
CUSTOM_FLAGS 
BLOCK_CIPHER_custom (NID_aes, 256, 1, 12, gcm, GCM, EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_AEAD_CIPHER|CUSTOM_FLAGS) static int aes_xts_ctrl(EVP_CIPHER_CTX *c
 
 if (type!=EVP_CTRL_INIT)
 
 BLOCK_CIPHER_custom (NID_aes, 128, 1, 16, xts, XTS, EVP_CIPH_FLAG_FIPS|XTS_FLAGS) BLOCK_CIPHER_custom(NID_aes
 
 BLOCK_CIPHER_custom (NID_aes, 128, 1, 12, ccm, CCM, EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS) BLOCK_CIPHER_custom(NID_aes
 

Variables

 gcm
 
 GCM
 
EVP_CIPH_FLAG_FIPS
EVP_CIPH_FLAG_AEAD_CIPHER
CUSTOM_FLAGS int 
type
 
EVP_CIPH_FLAG_FIPS
EVP_CIPH_FLAG_AEAD_CIPHER
CUSTOM_FLAGS int int 
arg
 
EVP_CIPH_FLAG_FIPS
EVP_CIPH_FLAG_AEAD_CIPHER
CUSTOM_FLAGS int int void
ptr
 
 xts
 
 XTS
 
 ccm
 
 CCM
 

Macro Definition Documentation

#define aes_ccm_cleanup   NULL

Definition at line 1306 of file e_aes.c.

#define aes_xts_cleanup   NULL

Definition at line 1147 of file e_aes.c.

#define BLOCK_CIPHER_custom (   nid,
  keylen,
  blocksize,
  ivlen,
  mode,
  MODE,
  flags 
)
Value:
static const EVP_CIPHER aes_##keylen##_##mode = { \
nid##_##keylen##_##mode,blocksize, \
(EVP_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE?2:1)*keylen/8, ivlen, \
flags|EVP_CIPH_##MODE##_MODE, \
aes_##mode##_init_key, \
aes_##mode##_cipher, \
aes_##mode##_cleanup, \
sizeof(EVP_AES_##MODE##_CTX), \
NULL,NULL,aes_##mode##_ctrl,NULL }; \
const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
{ return &aes_##keylen##_##mode; }

Definition at line 473 of file e_aes.c.

#define BLOCK_CIPHER_generic (   nid,
  keylen,
  blocksize,
  ivlen,
  nmode,
  mode,
  MODE,
  flags 
)
Value:
static const EVP_CIPHER aes_##keylen##_##mode = { \
nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \
flags|EVP_CIPH_##MODE##_MODE, \
aes_init_key, \
aes_##mode##_cipher, \
NULL, \
sizeof(EVP_AES_KEY), \
NULL,NULL,NULL,NULL }; \
const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
{ return &aes_##keylen##_##mode; }

Definition at line 461 of file e_aes.c.

#define BLOCK_CIPHER_generic_pack (   nid,
  keylen,
  flags 
)
Value:
BLOCK_CIPHER_generic(nid,keylen,16,0,ecb,ecb,ECB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
BLOCK_CIPHER_generic(nid,keylen,1,16,ofb128,ofb,OFB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
BLOCK_CIPHER_generic(nid,keylen,1,16,cfb128,cfb,CFB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
BLOCK_CIPHER_generic(nid,keylen,1,16,cfb1,cfb1,CFB,flags) \
BLOCK_CIPHER_generic(nid,keylen,1,16,cfb8,cfb8,CFB,flags) \
BLOCK_CIPHER_generic(nid,keylen,1,16,ctr,ctr,CTR,flags)

Definition at line 487 of file e_aes.c.

#define CUSTOM_FLAGS
#define MAXBITCHUNK   ((size_t)1<<(sizeof(size_t)*8-4))

Definition at line 109 of file e_aes.c.

#define XTS_FLAGS

Function Documentation

BLOCK_CIPHER_custom ( NID_aes  ,
128  ,
,
12  ,
gcm  ,
GCM  ,
EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_AEAD_CIPHER CUSTOM_FLAGS 
)
EVP_CIPH_FLAG_FIPS EVP_CIPH_FLAG_AEAD_CIPHER CUSTOM_FLAGS BLOCK_CIPHER_custom ( NID_aes  ,
256  ,
,
12  ,
gcm  ,
GCM  ,
EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_AEAD_CIPHER CUSTOM_FLAGS 
)
BLOCK_CIPHER_custom ( NID_aes  ,
128  ,
,
16  ,
xts  ,
XTS  ,
EVP_CIPH_FLAG_FIPS XTS_FLAGS 
)
BLOCK_CIPHER_custom ( NID_aes  ,
128  ,
,
12  ,
ccm  ,
CCM  ,
EVP_CIPH_FLAG_FIPS CUSTOM_FLAGS 
)
BLOCK_CIPHER_generic_pack ( BLOCK_CIPHER_generic_pack(  NID_aes,
128  ,
EVP_CIPH_FLAG_FIPS   
)

Definition at line 673 of file e_aes.c.

if ( type!  = EVP_CTRL_INIT)

Definition at line 1044 of file e_aes.c.

Variable Documentation

Definition at line 1041 of file e_aes.c.

ccm

Definition at line 1309 of file e_aes.c.

CCM

Definition at line 1309 of file e_aes.c.

GCM

Definition at line 1036 of file e_aes.c.

gcm

Definition at line 1036 of file e_aes.c.

Initial value:
{
EVP_AES_XTS_CTX *xctx = c->cipher_data

Definition at line 1042 of file e_aes.c.

const char int type

Definition at line 1041 of file e_aes.c.

XTS

Definition at line 1153 of file e_aes.c.

xts

Definition at line 1153 of file e_aes.c.