if(1 != EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, 7, NULL))
handleErrors();
- for(int i=0;i<16;i++) {
- printf("%d ",tag[i]);
- }
- printf("\n");
-
/* Set expected tag value. */
if(1 != EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, 16, tag))
handleErrors();
- for(int i=0;i<16;i++) {
- printf("%d ",tag[i]);
- }
- printf("\n");
+
/* Initialise key and IV */
if(1 != EVP_DecryptInit_ex(ctx, NULL, NULL, key, iv)) handleErrors();
*/
ret = EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len);
- printf("RET %d len %d\n",ret,len);
+ // printf("RET %d len %d\n",ret,len);
plaintext_len = len;
- for(int i=0;i<16;i++)
+ /* for(int i=0;i<16;i++)
printf("%d ",tag[i]);
printf("\n");
-
-// for(i=0;i<nb_test;i++)
+ */
+ for(i=0;i<nb_test;i++)
{
ciphertext_len = encryptccm (plaintext, imsize, plaintext, imsize, key, iv,
ciphertext, tag);
}
- for(int i=0;i<16;i++) {
+ /*for(int i=0;i<16;i++) {
printf("%d ",tag[i]);
}
- printf("\n");
+ printf("\n");*/
time_encrypt+=TimeStop(t);
// printf("Time encrypt %f\n",time);
- printf("%f\t",(double)imsize*nb_test/time_encrypt);
+ printf("%e\t",(double)imsize*nb_test/time_encrypt);
if(lena) {
for(int i=0;i<oneD;i++) {
- //for(int i=0;i<nb_test;i++)
+ for(int i=0;i<nb_test;i++)
{
/* Decrypt the ciphertext */
decryptedtext_len = decryptccm(ciphertext, ciphertext_len,ciphertext, ciphertext_len,tag, key, iv,
time_decrypt+=TimeStop(t);
//printf("Time decrypt %f\n",time);
- printf("%f\t",(double)imsize*nb_test/time_decrypt);
+ printf("%e\t",(double)imsize*nb_test/time_decrypt);
if(lena) {
for(int i=0;i<oneD;i++) {
time_encrypt+=TimeStop(t);
// printf("Time encrypt %f\n",time);
- printf("%f\t",(double)imsize*nb_test/time_encrypt);
+ printf("%e\t",(double)imsize*nb_test/time_encrypt);
if(lena) {
for(int i=0;i<oneD;i++) {
time_decrypt+=TimeStop(t);
//printf("Time decrypt %f\n",time);
- printf("%f\t",(double)imsize*nb_test/time_decrypt);
+ printf("%e\t",(double)imsize*nb_test/time_decrypt);
if(lena) {
for(int i=0;i<oneD;i++) {