+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;
+
+}
+
+