X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/a503f71d90ef2d1946c0088e01513805092f3cce..33996e0790e42d311ac3c4e04f92759acb697bde:/IDA/ida.cpp?ds=sidebyside diff --git a/IDA/ida.cpp b/IDA/ida.cpp index 9a1d31b..e854c3a 100644 --- a/IDA/ida.cpp +++ b/IDA/ida.cpp @@ -1,6 +1,3 @@ -// g++ -std=c++11 -O4 -msse2 -msse3 -msse4 -fopenmp -O3 test_mat2.cpp -o test_mat2 -I /home/couturie/tools/armadillo-6.200.5/include/ -lc -lm -lpthread -lgfortran -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=8 -DNO_AFFINITY -UCOMPLEX -DDOUBLE -I/home/couturie/tools/openblas/include -I/home/couturie/Downloads/OpenBLAS-0.2.15/ /home/couturie/tools/openblas/lib/libopenblas_haswellp-r0.2.15.a - - #include #include @@ -158,13 +155,16 @@ convert_vec250_to_vec256(vector vec250){ Mat readFullFile(int n, int k, long& sizeFile, int &lc) { // ifstream stream("lena.png", ios::in | ios::binary | ios::ate); - ifstream stream("/home/couturie/Downloads/CARCARIASS.zip", ios::in | ios::binary | ios::ate); -// ifstream stream("lena_small2.png", ios::in | ios::binary | ios::ate); + ifstream stream("lena_small2.png", ios::in | ios::binary | ios::ate); +// ifstream stream("/home/couturie/Downloads/CARCARIASS.zip", ios::in | ios::binary | ios::ate); + sizeFile=stream.tellg(); cout< readFullFile(int n, int k, long& sizeFile, int &lc) { tmpSize>>=8; } +//we rebuild the size in order to check that the routine is correct cout<<"rebuild"<=0;i--) { @@ -193,6 +194,14 @@ Mat readFullFile(int n, int k, long& sizeFile, int &lc) { // for(int i=0;i<8;i++) // contents.insert(i,mysize[i]); contents.insert (contents.begin(), mysize, mysize+8); + + cout<<"start of the vector"< contents2=convert_vec256_to_vec250(contents); cout<<"res contents2 "< matData(&contents2[0],1,contents2.size()); @@ -242,12 +251,9 @@ int main( int argc, char *argv[] ) { - int full=0; int n=8; int k=4; - int Tb=64; - int l=10;//399*Tb; @@ -292,14 +298,21 @@ int main( int argc, char *argv[] ) { cout<<"tatat"< C3; + + int off=0; + //read k files among n - for(int i=0;i=0;i--) { + for(int i=0+off;i d2=readFile(str.c_str()); - C3.insert_rows(i,d2); + C3.insert_rows(l,d2); + l++; } @@ -310,6 +323,7 @@ int main( int argc, char *argv[] ) { Mat Cs=conv_to>::from(C3); cout< S2=conv_to>::from(SS2); S2=mod(S2,mm); -// cout< res =conv_to< vector >::from(S2.row(0)); cout<<"res size "< res2=convert_vec250_to_vec256(res); cout<<"res2 size "<