Hi all,
I'near to integrate my AES-CCM in openssl, but I need a little help. I've
created my file AES_CCM_encrypt (I'm sure it's ok), I saved it in crypto/aes and
added the prototipe in crypto/aes/aes.h


Then I modified the following files:

file crypto/objects/objects.txt
modified line 660
!Alias nistAlgorithms csor 8    (it was 4)
added this line
aes 81                  : AES-128-CCM           : aes-128-ccm
(
automatically openssl modified files obj_mac.h, obj_dat.h and object_mac.num
...now obj_mac.h now has this lines
#define SN_aes_128_ccm          "AES-128-CCM"
#define LN_aes_128_ccm          "aes-128-ccm"
#define NID_aes_128_ccm         650
#define OBJ_aes_128_ccm         OBJ_aes,81L
... and similar modifies for obj_dat.h and object_mac.num)

File /crypto/evp/e_aes.c
added these lines
IMPLEMENT_BLOCK_CIPHER_CCM(aes_128, ks, AES, EVP_AES_KEY,
                       NID_aes_128, 16, 16, 16, 128,
                       0, aes_init_key, NULL,
                       EVP_CIPHER_set_asn1_iv,
                       EVP_CIPHER_get_asn1_iv,
                       NULL)

File /crypto/evp/evp_locl.h
added these lines
#define IMPLEMENT_BLOCK_CIPHER_CCM(cname, ksched, cprefix, kstruct, nid, \
block_size, key_len, iv_len, cbits, flags, init_key, cleanup,
set_asn1, get_asn1, ctrl) \
static int cname##_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const
unsigned char *in, unsigned int inl) \
{\
cprefix##_CCM_encrypt(in, out, (unsigned long)inl, ctx->iv,&((kstruct
*)ctx->cipher_data)->ksched, ctx->encrypt);\
return 1;\
}\
BLOCK_CIPHER_def1(cname, ccm, ccm, CCM, kstruct, nid, block_size, key_len, \
iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)


File /crypto/evp/evp.h
added this line
const EVP_CIPHER *EVP_aes_128_ccm(void);


Now I'm sure if I run the command "openssl enc -aes-128-ccm -in file1 -out
file2" it should funcion as I want, but I got an error of segmentation fault, I
know that it it due to AES_encrypt, in particular in building the struct
AES_KEY, in fact if I ask my program to print its values "key->rounds" and
"key->rd_key" I found they are all set to 0, while key->rounds must be 10, 12 or
14. If I ask other modes of aes prsent in openssl, they also use AES_encrypt,
but the values "key->rounds" and "key->rd_key" are
correct.
Is there anyone who can help me?


Have a nice day!
Paolo SERRA


______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]

Reply via email to