X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/d463aa6b004f2432356128d77de09592ae822611..fd03c6c18761aedcf1616b4dadc316fbb07ebde3:/OneRoundIoT/openssl/openssl_evp_ccm.c?ds=inline diff --git a/OneRoundIoT/openssl/openssl_evp_ccm.c b/OneRoundIoT/openssl/openssl_evp_ccm.c index 74549f8..ad5324d 100644 --- a/OneRoundIoT/openssl/openssl_evp_ccm.c +++ b/OneRoundIoT/openssl/openssl_evp_ccm.c @@ -129,18 +129,10 @@ int decryptccm(unsigned char *ciphertext, int ciphertext_len, unsigned char *aad 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(); @@ -161,7 +153,7 @@ int decryptccm(unsigned char *ciphertext, int ciphertext_len, unsigned char *aad */ 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; @@ -434,23 +426,23 @@ int main (int argc, char** argv) - for(int i=0;i<16;i++) + /* for(int i=0;i<16;i++) printf("%d ",tag[i]); printf("\n"); - -// for(i=0;i