]> AND Private Git Repository - Cipher_code.git/blobdiff - OneRoundIoT/EnhancedOneRound/Simon_speck/C/user_tool.c
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
add other hash
[Cipher_code.git] / OneRoundIoT / EnhancedOneRound / Simon_speck / C / user_tool.c
index 7bab14108434c129c9c7602efca8cb937e5b4911..33cebf7442a6c2d13317912e8e20c30a64ee236b 100644 (file)
@@ -1,3 +1,6 @@
+////USAGE : ./user speck_256_128 ECB -e key lena.ppm tests.cip
+
+
 //user simon_64_32 12 -e key tests tests.cip
 
 //
@@ -168,17 +171,22 @@ int main(int argc, char *argv[]) {
     printf("Block Size: %d\n", my_cipher.block_size);
 
 
+    uint8_t *backup_buffer;
+    uint8_t *start=working_buffer;
     double t=TimeStart();
+
     
-    uint8_t *backup_buffer = working_buffer;
-    for(int block=0; block < input_size / block_size; block++){
+    for(int i=0;i<100;i++) {
+      working_buffer=start;
+      backup_buffer = working_buffer;
+      for(int block=0; block < input_size / block_size; block++){
         (*operationPtr)(my_cipher, working_buffer, working_buffer);
         working_buffer += block_size;
+      }
     }
 
-
     double time=TimeStop(t);
-    printf("ratio %e\n",(double)input_size/time);
+    printf("ratio %e\n",(double)input_size*100/time);
     
     FILE *out_fd;
     out_fd = fopen(argv[6],"wb");