OpenSSL  1.0.1c
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Macros | Functions
evp_locl.h File Reference

Go to the source code of this file.

Classes

struct  evp_pkey_ctx_st
 
struct  evp_pkey_method_st
 

Macros

#define BLOCK_CIPHER_ecb_loop()
 
#define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched)
 
#define EVP_MAXCHUNK   ((size_t)1<<(sizeof(long)*8-2))
 
#define BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched)
 
#define BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched)
 
#define BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched)
 
#define BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched)
 
#define BLOCK_CIPHER_def1(cname, nmode, mode, MODE, kstruct, nid, block_size, key_len, iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
 
#define BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
 
#define BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
 
#define BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
 
#define BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
 
#define BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, cbits, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
 
#define IMPLEMENT_BLOCK_CIPHER(cname, ksched, cprefix, kstruct, nid, block_size, key_len, iv_len, cbits, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
 
#define EVP_C_DATA(kstruct, ctx)   ((kstruct *)(ctx)->cipher_data)
 
#define IMPLEMENT_CFBR(cipher, cprefix, kstruct, ksched, keysize, cbits, iv_len)
 
#define EVP_PKEY_FLAG_DYNAMIC   1
 

Functions

void evp_pkey_set_cb_translate (BN_GENCB *cb, EVP_PKEY_CTX *ctx)
 
int PKCS5_v2_PBKDF2_keyivgen (EVP_CIPHER_CTX *ctx, const char *pass, int passlen, ASN1_TYPE *param, const EVP_CIPHER *c, const EVP_MD *md, int en_de)
 

Macro Definition Documentation

#define BLOCK_CIPHER_all_funcs (   cname,
  cprefix,
  cbits,
  kstruct,
  ksched 
)
Value:
BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \
BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched)

Definition at line 127 of file evp_locl.h.

#define BLOCK_CIPHER_def1 (   cname,
  nmode,
  mode,
  MODE,
  kstruct,
  nid,
  block_size,
  key_len,
  iv_len,
  flags,
  init_key,
  cleanup,
  set_asn1,
  get_asn1,
  ctrl 
)
Value:
static const EVP_CIPHER cname##_##mode = { \
nid##_##nmode, block_size, key_len, iv_len, \
flags | EVP_CIPH_##MODE##_MODE, \
init_key, \
cname##_##mode##_cipher, \
cleanup, \
sizeof(kstruct), \
set_asn1, get_asn1,\
ctrl, \
NULL \
}; \
const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }

Definition at line 133 of file evp_locl.h.

#define BLOCK_CIPHER_def_cbc (   cname,
  kstruct,
  nid,
  block_size,
  key_len,
  iv_len,
  flags,
  init_key,
  cleanup,
  set_asn1,
  get_asn1,
  ctrl 
)
Value:
BLOCK_CIPHER_def1(cname, cbc, cbc, CBC, kstruct, nid, block_size, key_len, \
iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)

Definition at line 149 of file evp_locl.h.

#define BLOCK_CIPHER_def_cfb (   cname,
  kstruct,
  nid,
  key_len,
  iv_len,
  cbits,
  flags,
  init_key,
  cleanup,
  set_asn1,
  get_asn1,
  ctrl 
)
Value:
BLOCK_CIPHER_def1(cname, cfb##cbits, cfb##cbits, CFB, kstruct, nid, 1, \
key_len, iv_len, flags, init_key, cleanup, set_asn1, \
get_asn1, ctrl)

Definition at line 155 of file evp_locl.h.

#define BLOCK_CIPHER_def_ecb (   cname,
  kstruct,
  nid,
  block_size,
  key_len,
  flags,
  init_key,
  cleanup,
  set_asn1,
  get_asn1,
  ctrl 
)
Value:
BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \
0, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)

Definition at line 169 of file evp_locl.h.

#define BLOCK_CIPHER_def_ofb (   cname,
  kstruct,
  nid,
  key_len,
  iv_len,
  cbits,
  flags,
  init_key,
  cleanup,
  set_asn1,
  get_asn1,
  ctrl 
)
Value:
BLOCK_CIPHER_def1(cname, ofb##cbits, ofb, OFB, kstruct, nid, 1, \
key_len, iv_len, flags, init_key, cleanup, set_asn1, \
get_asn1, ctrl)

Definition at line 162 of file evp_locl.h.

#define BLOCK_CIPHER_defs (   cname,
  kstruct,
  nid,
  block_size,
  key_len,
  iv_len,
  cbits,
  flags,
  init_key,
  cleanup,
  set_asn1,
  get_asn1,
  ctrl 
)
Value:
BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, \
init_key, cleanup, set_asn1, get_asn1, ctrl) \
BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, \
flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \
flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags, \
init_key, cleanup, set_asn1, get_asn1, ctrl)

Definition at line 175 of file evp_locl.h.

#define BLOCK_CIPHER_ecb_loop ( )
Value:
size_t i, bl; \
bl = ctx->cipher->block_size;\
if(inl < bl) return 1;\
inl -= bl; \
for(i=0; i <= inl; i+=bl)

Definition at line 63 of file evp_locl.h.

#define BLOCK_CIPHER_func_cbc (   cname,
  cprefix,
  kstruct,
  ksched 
)
Value:
static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
{\
while(inl>=EVP_MAXCHUNK) \
{\
cprefix##_cbc_encrypt(in, out, (long)EVP_MAXCHUNK, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, ctx->encrypt);\
inl-=EVP_MAXCHUNK;\
in +=EVP_MAXCHUNK;\
out+=EVP_MAXCHUNK;\
}\
if (inl)\
cprefix##_cbc_encrypt(in, out, (long)inl, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, ctx->encrypt);\
return 1;\
}

Definition at line 95 of file evp_locl.h.

#define BLOCK_CIPHER_func_cfb (   cname,
  cprefix,
  cbits,
  kstruct,
  ksched 
)
Value:
static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
{\
size_t chunk=EVP_MAXCHUNK;\
if (cbits==1) chunk>>=3;\
if (inl<chunk) chunk=inl;\
while(inl && inl>=chunk)\
{\
cprefix##_cfb##cbits##_encrypt(in, out, (long)((cbits==1) && !(ctx->flags & EVP_CIPH_FLAG_LENGTH_BITS) ?inl*8:inl), &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num, ctx->encrypt);\
inl-=chunk;\
in +=chunk;\
out+=chunk;\
if(inl<chunk) chunk=inl;\
}\
return 1;\
}

Definition at line 110 of file evp_locl.h.

#define BLOCK_CIPHER_func_ecb (   cname,
  cprefix,
  kstruct,
  ksched 
)
Value:
static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
{\
BLOCK_CIPHER_ecb_loop() \
cprefix##_ecb_encrypt(in + i, out + i, &((kstruct *)ctx->cipher_data)->ksched, ctx->encrypt);\
return 1;\
}

Definition at line 70 of file evp_locl.h.

#define BLOCK_CIPHER_func_ofb (   cname,
  cprefix,
  cbits,
  kstruct,
  ksched 
)
Value:
static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
{\
while(inl>=EVP_MAXCHUNK)\
{\
cprefix##_ofb##cbits##_encrypt(in, out, (long)EVP_MAXCHUNK, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num);\
inl-=EVP_MAXCHUNK;\
in +=EVP_MAXCHUNK;\
out+=EVP_MAXCHUNK;\
}\
if (inl)\
cprefix##_ofb##cbits##_encrypt(in, out, (long)inl, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num);\
return 1;\
}

Definition at line 80 of file evp_locl.h.

#define EVP_C_DATA (   kstruct,
  ctx 
)    ((kstruct *)(ctx)->cipher_data)

Definition at line 255 of file evp_locl.h.

#define EVP_MAXCHUNK   ((size_t)1<<(sizeof(long)*8-2))

Definition at line 78 of file evp_locl.h.

#define EVP_PKEY_FLAG_DYNAMIC   1

Definition at line 289 of file evp_locl.h.

#define IMPLEMENT_BLOCK_CIPHER (   cname,
  ksched,
  cprefix,
  kstruct,
  nid,
  block_size,
  key_len,
  iv_len,
  cbits,
  flags,
  init_key,
  cleanup,
  set_asn1,
  get_asn1,
  ctrl 
)
Value:
BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, \
cbits, flags, init_key, cleanup, set_asn1, \
get_asn1, ctrl)

Definition at line 246 of file evp_locl.h.

#define IMPLEMENT_CFBR (   cipher,
  cprefix,
  kstruct,
  ksched,
  keysize,
  cbits,
  iv_len 
)
Value:
BLOCK_CIPHER_func_cfb(cipher##_##keysize,cprefix,cbits,kstruct,ksched) \
BLOCK_CIPHER_def_cfb(cipher##_##keysize,kstruct, \
NID_##cipher##_##keysize, keysize/8, iv_len, cbits, \
0, cipher##_init_key, NULL, \
NULL)

Definition at line 257 of file evp_locl.h.

Function Documentation

void evp_pkey_set_cb_translate ( BN_GENCB cb,
EVP_PKEY_CTX ctx 
)

Definition at line 187 of file pmeth_gn.c.

int PKCS5_v2_PBKDF2_keyivgen ( EVP_CIPHER_CTX ctx,
const char *  pass,
int  passlen,
ASN1_TYPE param,
const EVP_CIPHER c,
const EVP_MD md,
int  en_de 
)

Definition at line 230 of file p5_crpt2.c.