From d42def9d0be17813b2bedc52ae7bc4ac6a356c5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Couturier?= Date: Tue, 3 Aug 2021 13:41:49 +0200 Subject: [PATCH] new --- OneRoundIoT/openssl/openssl_evp_ccm.c | 28 ++++++++++----------------- OneRoundIoT/openssl/openssl_evp_gcm.c | 4 ++-- 2 files changed, 12 insertions(+), 20 deletions(-) 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