X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/f6ef606bbfb5337e5fc9df4c26bb67890188ce52..d0a88fab9692b529b0912826afeffcb0decfb63c:/SboxAES/aes1.c?ds=sidebyside diff --git a/SboxAES/aes1.c b/SboxAES/aes1.c index 325eae0..1684d0b 100644 --- a/SboxAES/aes1.c +++ b/SboxAES/aes1.c @@ -176,6 +176,16 @@ static void aes128_dec(__m128i *key_schedule, uint8_t *cipherText,uint8_t *plain _mm_storeu_si128((__m128i *) plainText, m); } + + + + + + + + + + //return 0 if no error //1 if encryption failed //2 if decryption failed @@ -378,12 +388,19 @@ static void test_aes128(void){ */ - const int nb_times_init=1; + const int nb_times_init=1000000; double time=0; double t=TimeStart(); for(int i=0;i<nb_times_init;i++) { rc4key(enc_key,sbox,16); + } + time=TimeStop(t); + printf("init Sbox generation %f\n",time); + + + t=TimeStart(); + for(int i=0;i<nb_times_init;i++) { KeyExpansion(RoundKey, enc_key, 10); // printf("MY KEYS\n"); @@ -394,7 +411,7 @@ static void test_aes128(void){ aes128_load_key_dec_only(my_key_schedule); } time=TimeStop(t); - printf("init our aes %f\n",time); + printf("init our Key schedule aes %f\n",time); /*