From: couturie <you@example.com>
Date: Wed, 25 Jul 2018 12:10:17 +0000 (+0200)
Subject: udpate oe round
X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/commitdiff_plain/7c98efa79737de9ab1562b4cc33bbbe7d1178bba?ds=sidebyside;hp=901fa44fed1c329fd123c6d99a15bc7be5443e41

udpate oe round
---

diff --git a/OneRoundIoT/OneRound/one_round_new.cpp b/OneRoundIoT/OneRound/one_round_new.cpp
index b936005..f5546cf 100644
--- a/OneRoundIoT/OneRound/one_round_new.cpp
+++ b/OneRoundIoT/OneRound/one_round_new.cpp
@@ -178,6 +178,24 @@ void encrypt_ctr(uchar* seq_in, uchar *seq_out, int len,uchar* RM1,int *Pbox, in
     }
 
 
+    for(int a=0;a<h2;a+=4) {
+
+      myrand=xorshift32(myrand);
+      uint mm=myrand;
+
+      X[a]=X[a]^(mm&255);
+      mm>>=8;
+      X[a+1]=X[a+1]^(mm&255);
+      mm>>=8;
+      X[a+2]=X[a+2]^(mm&255);
+      mm>>=8;
+      X[a+3]=X[a+3]^(mm&255);
+    }
+
+
+
+
+    
     for(int a=0;a<h2;a+=4) {
       X[a]=Sbox1[X[a]];
       X[a+1]=Sbox1[X[a+1]];
@@ -193,17 +211,11 @@ void encrypt_ctr(uchar* seq_in, uchar *seq_out, int len,uchar* RM1,int *Pbox, in
     }
 
     for(int a=0;a<h2;a+=4) {
+      fX[a]=X[a]^seq_in[ind2+a];
+      fX[a+1]=X[a+1]^seq_in[ind2+a+1];
+      fX[a+2]=X[a+2]^seq_in[ind2+a+2];
+      fX[a+3]=X[a+3]^seq_in[ind2+a+3];
 
-      myrand=xorshift32(myrand);
-      uint mm=myrand;
-
-      fX[a]=fX[a]^seq_in[ind2+a]^(mm&255);
-      mm>>=8;
-      fX[a+1]=fX[a+1]^seq_in[ind2+a+1]^(mm&255);
-      mm>>=8;
-      fX[a+2]=fX[a+2]^seq_in[ind2+a+2]^(mm&255);
-      mm>>=8;
-      fX[a+3]=fX[a+3]^seq_in[ind2+a+3]^(mm&255);
     }
 
 
diff --git a/OneRoundIoT/execution_opi.py b/OneRoundIoT/execution_opi.py
index e782204..7cc4cc8 100644
--- a/OneRoundIoT/execution_opi.py
+++ b/OneRoundIoT/execution_opi.py
@@ -1,14 +1,42 @@
 import matplotlib.pyplot as plt
 import numpy as np
 import pandas as pd
-
+from ggplot import *
 
 open=pd.read_csv("execution_openssl_rpi3.txt",sep='\t',header=None)
 one=pd.read_csv("execution_oneround_rpi3.txt",sep='\t',header=None)
-open.drop(open.columns[[5]], axis=1, inplace=True)
-one.drop(one.columns[[5]], axis=1, inplace=True)
-print(a)
 
-#plt.plot([1,2,3,4])
-#plt.ylabel('some numbers')
-#plt.show()
+
+open=open.drop(open.columns[[4,5]], axis=1)
+one=one.drop(one.columns[[0,4,5]], axis=1)
+
+open.columns = ["Buffer","OpenSSL enc CBC","OpenSSL dec CBC", "OpenSSL (en|de)c CTR"]
+
+one.columns=["OneRound enc DECB", "OneRound dec DECB", "OneRound (en|de)c CTR"]
+
+print(one)
+print(open)
+
+res=pd.concat([open,one],axis=1)
+#print(res)
+
+res2 = pd.melt(res, id_vars=['Buffer'])
+
+print(res2)
+
+
+print(ggplot(res2,aes("Buffer","value")) +   \
+    geom_line(aes(colour="variable")) + \
+#    geom_line(color='coral') + \
+    scale_x_continuous("Buffer size",trans="log10") + \
+    scale_y_continuous("Bytes per second",trans="log10",breaks=[1e7,2e8,1e7]))
+#    theme(axis_text=element_text(size=20, color='green'), x_axis_text=element_text(angle=45)) +\
+
+
+#    annotation_logticks())
+    #scale_x_date(breaks=date_breaks('36 months'), labels='%Y') + \
+#    scale_y_continuous(labels='millions'))
+
+      
+      #theme(legend.position="top") 
+ # geom_line(aes(colour="Legend"))) +\