32 #if defined(POLARSSL_CIPHER_C)
36 #if defined(POLARSSL_AES_C)
40 #if defined(POLARSSL_CAMELLIA_C)
44 #if defined(POLARSSL_DES_C)
48 #if defined(POLARSSL_BLOWFISH_C)
54 #if defined(POLARSSL_AES_C)
56 int aes_crypt_cbc_wrap(
void *ctx,
operation_t operation,
size_t length,
57 unsigned char *iv,
const unsigned char *input,
unsigned char *output )
62 int aes_crypt_cfb128_wrap(
void *ctx,
operation_t operation,
size_t length,
63 size_t *iv_off,
unsigned char *iv,
const unsigned char *input,
unsigned char *output )
65 #if defined(POLARSSL_CIPHER_MODE_CFB)
80 int aes_crypt_ctr_wrap(
void *ctx,
size_t length,
81 size_t *nc_off,
unsigned char *nonce_counter,
unsigned char *stream_block,
82 const unsigned char *input,
unsigned char *output )
84 #if defined(POLARSSL_CIPHER_MODE_CTR)
86 stream_block, input, output );
91 ((void) nonce_counter);
92 ((void) stream_block);
100 int aes_setkey_dec_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
105 int aes_setkey_enc_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
110 static void * aes_ctx_alloc(
void )
115 static void aes_ctx_free(
void *ctx )
123 aes_crypt_cfb128_wrap,
161 #if defined(POLARSSL_CIPHER_MODE_CFB)
193 #if defined(POLARSSL_CIPHER_MODE_CTR)
227 #if defined(POLARSSL_CAMELLIA_C)
229 int camellia_crypt_cbc_wrap(
void *ctx,
operation_t operation,
size_t length,
230 unsigned char *iv,
const unsigned char *input,
unsigned char *output )
235 int camellia_crypt_cfb128_wrap(
void *ctx,
operation_t operation,
size_t length,
236 size_t *iv_off,
unsigned char *iv,
const unsigned char *input,
unsigned char *output )
238 #if defined(POLARSSL_CIPHER_MODE_CFB)
253 int camellia_crypt_ctr_wrap(
void *ctx,
size_t length,
254 size_t *nc_off,
unsigned char *nonce_counter,
unsigned char *stream_block,
255 const unsigned char *input,
unsigned char *output )
257 #if defined(POLARSSL_CIPHER_MODE_CTR)
259 stream_block, input, output );
264 ((void) nonce_counter);
265 ((void) stream_block);
273 int camellia_setkey_dec_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
278 int camellia_setkey_enc_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
283 static void * camellia_ctx_alloc(
void )
288 static void camellia_ctx_free(
void *ctx )
295 camellia_crypt_cbc_wrap,
296 camellia_crypt_cfb128_wrap,
297 camellia_crypt_ctr_wrap,
298 camellia_setkey_enc_wrap,
299 camellia_setkey_dec_wrap,
334 #if defined(POLARSSL_CIPHER_MODE_CFB)
339 "CAMELLIA-128-CFB128",
349 "CAMELLIA-192-CFB128",
359 "CAMELLIA-256-CFB128",
366 #if defined(POLARSSL_CIPHER_MODE_CTR)
400 #if defined(POLARSSL_DES_C)
402 int des_crypt_cbc_wrap(
void *ctx,
operation_t operation,
size_t length,
403 unsigned char *iv,
const unsigned char *input,
unsigned char *output )
408 int des3_crypt_cbc_wrap(
void *ctx,
operation_t operation,
size_t length,
409 unsigned char *iv,
const unsigned char *input,
unsigned char *output )
414 int des_crypt_cfb128_wrap(
void *ctx,
operation_t operation,
size_t length,
415 size_t *iv_off,
unsigned char *iv,
const unsigned char *input,
unsigned char *output )
428 int des_crypt_ctr_wrap(
void *ctx,
size_t length,
429 size_t *nc_off,
unsigned char *nonce_counter,
unsigned char *stream_block,
430 const unsigned char *input,
unsigned char *output )
435 ((void) nonce_counter);
436 ((void) stream_block);
444 int des_setkey_dec_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
451 int des_setkey_enc_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
458 int des3_set2key_dec_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
465 int des3_set2key_enc_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
472 int des3_set3key_dec_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
479 int des3_set3key_enc_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
486 static void * des_ctx_alloc(
void )
491 static void * des3_ctx_alloc(
void )
496 static void des_ctx_free(
void *ctx )
504 des_crypt_cfb128_wrap,
525 des_crypt_cfb128_wrap,
527 des3_set2key_enc_wrap,
528 des3_set2key_dec_wrap,
546 des_crypt_cfb128_wrap,
548 des3_set3key_enc_wrap,
549 des3_set3key_dec_wrap,
565 #if defined(POLARSSL_BLOWFISH_C)
567 int blowfish_crypt_cbc_wrap(
void *ctx,
operation_t operation,
size_t length,
568 unsigned char *iv,
const unsigned char *input,
unsigned char *output )
573 int blowfish_crypt_cfb64_wrap(
void *ctx,
operation_t operation,
size_t length,
574 size_t *iv_off,
unsigned char *iv,
const unsigned char *input,
unsigned char *output )
576 #if defined(POLARSSL_CIPHER_MODE_CFB)
591 int blowfish_crypt_ctr_wrap(
void *ctx,
size_t length,
592 size_t *nc_off,
unsigned char *nonce_counter,
unsigned char *stream_block,
593 const unsigned char *input,
unsigned char *output )
595 #if defined(POLARSSL_CIPHER_MODE_CTR)
597 stream_block, input, output );
602 ((void) nonce_counter);
603 ((void) stream_block);
611 int blowfish_setkey_dec_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
616 int blowfish_setkey_enc_wrap(
void *ctx,
const unsigned char *key,
unsigned int key_length )
621 static void * blowfish_ctx_alloc(
void )
626 static void blowfish_ctx_free(
void *ctx )
633 blowfish_crypt_cbc_wrap,
634 blowfish_crypt_cfb64_wrap,
635 blowfish_crypt_ctr_wrap,
636 blowfish_setkey_enc_wrap,
637 blowfish_setkey_dec_wrap,
652 #if defined(POLARSSL_CIPHER_MODE_CFB)
664 #if defined(POLARSSL_CIPHER_MODE_CTR)
677 #if defined(POLARSSL_CIPHER_NULL_CIPHER)
678 static void * null_ctx_alloc(
void )
684 static void null_ctx_free(
void *ctx )
const cipher_info_t blowfish_ctr_info
int blowfish_setkey(blowfish_context *ctx, const unsigned char *key, unsigned int keysize)
Blowfish key schedule.
const cipher_info_t blowfish_cbc_info
#define POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE
The selected feature is not available.
const cipher_info_t camellia_192_ctr_info
const cipher_info_t aes_128_ctr_info
const cipher_info_t camellia_192_cbc_info
Key length, in bits (including parity), for DES keys.
const cipher_info_t aes_256_ctr_info
int camellia_crypt_cbc(camellia_context *ctx, int mode, size_t length, unsigned char iv[16], const unsigned char *input, unsigned char *output)
CAMELLIA-CBC buffer encryption/decryption Length should be a multiple of the block size (16 bytes) ...
int aes_crypt_cfb128(aes_context *ctx, int mode, size_t length, size_t *iv_off, unsigned char iv[16], const unsigned char *input, unsigned char *output)
AES-CFB128 buffer encryption/decryption.
const cipher_info_t aes_128_cfb128_info
const cipher_info_t des_cbc_info
Configuration options (set of defines)
const cipher_info_t aes_256_cbc_info
int aes_setkey_dec(aes_context *ctx, const unsigned char *key, unsigned int keysize)
AES key schedule (decryption)
const cipher_info_t camellia_256_ctr_info
int camellia_setkey_enc(camellia_context *ctx, const unsigned char *key, unsigned int keysize)
CAMELLIA key schedule (encryption)
int camellia_crypt_ctr(camellia_context *ctx, size_t length, size_t *nc_off, unsigned char nonce_counter[16], unsigned char stream_block[16], const unsigned char *input, unsigned char *output)
CAMELLIA-CTR buffer encryption/decryption.
const cipher_info_t aes_192_ctr_info
const cipher_info_t camellia_128_ctr_info
const cipher_info_t blowfish_cfb64_info
const cipher_info_t des_ede3_cbc_info
int camellia_crypt_cfb128(camellia_context *ctx, int mode, size_t length, size_t *iv_off, unsigned char iv[16], const unsigned char *input, unsigned char *output)
CAMELLIA-CFB128 buffer encryption/decryption.
int des3_set3key_enc(des3_context *ctx, const unsigned char key[DES_KEY_SIZE *3])
Triple-DES key schedule (168-bit, encryption)
int des3_set3key_dec(des3_context *ctx, const unsigned char key[DES_KEY_SIZE *3])
Triple-DES key schedule (168-bit, decryption)
const cipher_info_t aes_128_cbc_info
const cipher_info_t des_ede_cbc_info
Triple-DES context structure.
int des3_set2key_enc(des3_context *ctx, const unsigned char key[DES_KEY_SIZE *2])
Triple-DES key schedule (112-bit, encryption)
int aes_crypt_cbc(aes_context *ctx, int mode, size_t length, unsigned char iv[16], const unsigned char *input, unsigned char *output)
AES-CBC buffer encryption/decryption Length should be a multiple of the block size (16 bytes) ...
Key length, in bits (including parity), for DES in three-key EDE.
const cipher_info_t camellia_256_cfb128_info
const cipher_info_t camellia_256_cbc_info
CAMELLIA context structure.
const cipher_info_t camellia_128_cbc_info
const cipher_info_t aes_192_cbc_info
int des_crypt_cbc(des_context *ctx, int mode, size_t length, unsigned char iv[8], const unsigned char *input, unsigned char *output)
DES-CBC buffer encryption/decryption.
int camellia_setkey_dec(camellia_context *ctx, const unsigned char *key, unsigned int keysize)
CAMELLIA key schedule (decryption)
int des_setkey_enc(des_context *ctx, const unsigned char key[DES_KEY_SIZE])
DES key schedule (56-bit, encryption)
const cipher_info_t aes_256_cfb128_info
int des_setkey_dec(des_context *ctx, const unsigned char key[DES_KEY_SIZE])
DES key schedule (56-bit, decryption)
const cipher_info_t aes_192_cfb128_info
int blowfish_crypt_ctr(blowfish_context *ctx, size_t length, size_t *nc_off, unsigned char nonce_counter[BLOWFISH_BLOCKSIZE], unsigned char stream_block[BLOWFISH_BLOCKSIZE], const unsigned char *input, unsigned char *output)
Blowfish-CTR buffer encryption/decryption.
int blowfish_crypt_cfb64(blowfish_context *ctx, int mode, size_t length, size_t *iv_off, unsigned char iv[BLOWFISH_BLOCKSIZE], const unsigned char *input, unsigned char *output)
Blowfish CFB buffer encryption/decryption.
Blowfish context structure.
const cipher_info_t camellia_192_cfb128_info
int aes_setkey_enc(aes_context *ctx, const unsigned char *key, unsigned int keysize)
AES key schedule (encryption)
Key length, in bits (including parity), for DES in two key EDE.
int aes_crypt_ctr(aes_context *ctx, size_t length, size_t *nc_off, unsigned char nonce_counter[16], unsigned char stream_block[16], const unsigned char *input, unsigned char *output)
AES-CTR buffer encryption/decryption.
int blowfish_crypt_cbc(blowfish_context *ctx, int mode, size_t length, unsigned char iv[BLOWFISH_BLOCKSIZE], const unsigned char *input, unsigned char *output)
Blowfish-CBC buffer encryption/decryption Length should be a multiple of the block size (8 bytes) ...
const cipher_info_t camellia_128_cfb128_info
int des3_set2key_dec(des3_context *ctx, const unsigned char key[DES_KEY_SIZE *2])
Triple-DES key schedule (112-bit, decryption)
int des3_crypt_cbc(des3_context *ctx, int mode, size_t length, unsigned char iv[8], const unsigned char *input, unsigned char *output)
3DES-CBC buffer encryption/decryption