X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/bb1f791ce80683443b326e62ae32c255bcff1010..c96430e0c7c0b315f878471051660405d3f89b99:/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 0197e43..b53b080 100644 --- a/IDA_new/ida_gf65_paper3.cpp +++ b/IDA_new/ida_gf65_paper3.cpp @@ -58,7 +58,7 @@ 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, float *toto) { mylong *product; int i, j, k; @@ -73,6 +73,7 @@ mylong *matrix_multiply(gf_t *gf, mylong *m1, mylong *m2, int r1, int c1, int r2 } } } + *toto=*toto+0.021; return product; } @@ -413,6 +414,7 @@ void saveFile8(mylong *data, const char *fileName,long size_file) { } + int main(int argc, char **argv) { unsigned int w; @@ -503,12 +505,15 @@ int main(int argc, char **argv) */ // sleep(2); + float toto=0.001; auto start = std::chrono::system_clock::now(); - matC=matrix_multiply(&gf, matG, matS, n, t, t, len, w); + for(int i=0;i<1000;i++) { + matC=matrix_multiply(&gf, matG, matS, n, t, t, len, w,&toto); + } auto end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end-start; total_time+=elapsed_seconds.count(); -// cout << "elapsed time: " << elapsed_seconds.count() << "s\n"; + cout << "elapsed time: " << elapsed_seconds.count() << "s "; // display(matC,t,t); @@ -629,14 +634,17 @@ int main(int argc, char **argv) // sleep(2); start = std::chrono::system_clock::now(); + toto=0.001; for(int i=0;i<1000;i++) { - matS2=matrix_multiply(&gf, matInvGs, matCs, t, t, t, len, w); + + matS2=matrix_multiply(&gf, matInvGs, matCs, t, t, t, len, w, &toto); + } end = std::chrono::system_clock::now(); elapsed_seconds = end-start; // cout << "elapsed time: " << elapsed_seconds.count() << "s\n"; total_time+=elapsed_seconds.count(); - cout/*<<"TOTAL TIME : "*/<