X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/d7ccdf4277c5abed2330432a7f455f2cac913f37..05e827b33399e6afb8bb674ddbe53ae49dce452f:/IDA_new/ida_gf65_paper3.cpp?ds=inline diff --git a/IDA_new/ida_gf65_paper3.cpp b/IDA_new/ida_gf65_paper3.cpp index c3d6578..dc4d3ab 100644 --- a/IDA_new/ida_gf65_paper3.cpp +++ b/IDA_new/ida_gf65_paper3.cpp @@ -58,10 +58,10 @@ void display(mylong *mat, int r, int c) { printf("\n"); } -mylong *matrix_multiply(gf_t *gf, mylong *m1, mylong *m2, int r1, int c1, int r2, int c2, int w) +mylong *matrix_multiply(gf_t *gf, mylong *m1, mylong *m2, int r1, int c1, int r2, int c2, int w, int iii) { mylong *product; - int i, j, k; + int i=iii, j, k; product = (mylong *) malloc(sizeof(mylong)*r1*c2); for (i = 0; i < r1*c2; i++) product[i] = 0; @@ -412,8 +412,6 @@ void saveFile8(mylong *data, const char *fileName,long size_file) { } -#define cli() __asm volatile( "cli" ::: "memory" ) -#define sei() __asm volatile( "sei" ::: "memory" ) int main(int argc, char **argv) @@ -507,7 +505,7 @@ int main(int argc, char **argv) // sleep(2); auto start = std::chrono::system_clock::now(); - matC=matrix_multiply(&gf, matG, matS, n, t, t, len, w); + matC=matrix_multiply(&gf, matG, matS, n, t, t, len, w,0); auto end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end-start; total_time+=elapsed_seconds.count(); @@ -633,11 +631,9 @@ int main(int argc, char **argv) // sleep(2); start = std::chrono::system_clock::now(); for(int i=0;i<1000;i++) { - float tt=i; - tt=t; - int tt2=tt; - matS2=matrix_multiply(&gf, matInvGs, matCs, tt2, tt2, tt2, len, w); - sei(); + + matS2=matrix_multiply(&gf, matInvGs, matCs, t, t, t, len, w, i); + } end = std::chrono::system_clock::now(); elapsed_seconds = end-start;