cout<<invIDAmat<<endl;
}
+void buildKRankIDA(Cube<byte>& IDAmat, int q, int n, int k, byte* DK) {
+
+ byte Sbox[256];
+ byte RM1[q*n*k];
+
+
+ rc4key(DK, Sbox, 8);
+ prga(Sbox, q*n*k, RM1);
+ Cube<byte> rm1(RM1,1,1,q*n*k);
+ rm1.reshape(n,k,q);
+
+ cout<<"rm1"<<endl;
+ cout<<rm1<<endl;
+
+
+
+
+// Construction of the IDA matrices
+ for(int i=0;i<q;i++) {
+ Mat<byte> sub(n,k);
+ sub.submat(0,0,n-1,k-1)=rm1.slice(i);
+
+
+ IDAmat.slice(i)=sub;
+
+
+ }
+ cout<<IDAmat<<endl;
+
+}
+
+
int main( int argc, char *argv[] ) {
-
+/*
// Initialization of IDA and inverse IDA matrix
Cube<byte> IDAmat(n,n,q);
Cube<short> invIDAmat(n,n,q);
buildFullRankIDA(IDAmat, invIDAmat, q, n, &DK[0]);
-
+*/
+
+
+
+ Cube<byte> IDAmat(n,k,q);
+ buildKRankIDA(Cube<byte>& IDAmat, q, n, k, &DK[0]);
// rc4key(&DK[8], sc, 16);