From: Raphaƫl Couturier Date: Wed, 4 Mar 2020 11:05:39 +0000 (+0100) Subject: new X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/commitdiff_plain/bd0fd45010fd0c1803d6368bd7d7dab255615f51 new --- diff --git a/OneRoundIoT/OneRound/one_round_hash_new2.cpp b/OneRoundIoT/OneRound/one_round_hash_new2.cpp index ae346fe..911d7f3 100644 --- a/OneRoundIoT/OneRound/one_round_hash_new2.cpp +++ b/OneRoundIoT/OneRound/one_round_hash_new2.cpp @@ -212,9 +212,9 @@ int main(int argc, char** argv) { } - cout< exe_hash_throughtput.txt + +import subprocess +import re + + + +print("#size \t h \t time") +print("variant 1"); +h=8 +for k in range(1,6): + result=subprocess.check_output("one_round_hash_new2 lena1 nb100 h"+str(h),shell=True) + res=result.decode() + print(str(512*512*3)+"\t"+str(h)+"\t"+res) + h=h+h + +print("variant 2"); +h=8 +for k in range(1,6): + result=subprocess.check_output("one_round_hash_new3 lena1 nb100 h"+str(h),shell=True) + res=result.decode() + print(str(512*512*3)+"\t"+str(h)+"\t"+res) + h=h+h + +print("cmac"); +h=8 +for k in range(1,6): + result=subprocess.check_output("../openssl/openssl_evp_cmac lena1 nb100 h"+str(h),shell=True) + res=result.decode() + print(str(512*512*3)+"\t"+str(h)+"\t"+res) + h=h+h + +print("hmac"); +h=8 +for k in range(1,6): + result=subprocess.check_output("../openssl/openssl_evp_hmac lena1 nb100 h"+str(h),shell=True) + res=result.decode() + print(str(512*512*3)+"\t"+str(h)+"\t"+res) + h=h+h diff --git a/OneRoundIoT/openssl/openssl_evp_cmac.c b/OneRoundIoT/openssl/openssl_evp_cmac.c index d8c0377..f1d3984 100755 --- a/OneRoundIoT/openssl/openssl_evp_cmac.c +++ b/OneRoundIoT/openssl/openssl_evp_cmac.c @@ -118,7 +118,7 @@ unsigned char mact[16] = {0}; if(1 != CMAC_Final(ctx, mact, &mactlen)) handleErrors(); ciphertext_len += len; - printBytes(mact, mactlen); + // printBytes(mact, mactlen); /* Clean up */ CMAC_CTX_free(ctx); diff --git a/OneRoundIoT/openssl/openssl_evp_hmac.c b/OneRoundIoT/openssl/openssl_evp_hmac.c index 59f5f8a..5e738ea 100644 --- a/OneRoundIoT/openssl/openssl_evp_hmac.c +++ b/OneRoundIoT/openssl/openssl_evp_hmac.c @@ -134,7 +134,7 @@ int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, ciphertext_len += len; - printBytes(hash_sha256, result_len); + // printBytes(hash_sha256, result_len); /* char *p = &hash_sha256_hex[0];