public blmat(String s) { int n, j, i = 0; n = s.Length / 16; String[] str; nBl = (16-(s.Length % 16));//asd if (s.Length % 16 != 0) { i = 1; str = new String[n+1]; } else str = new String[n]; for (j = 0; j < n; j++) str[j] = s.Substring(j*16, 16); if (i == 1) { str[n] = s.Substring(j * 16, s.Length - j * 16) + (new String('\v', (16 - (s.Length - j * 16)))); len = n + 1; } else len = n; blist=new bloc[len]; for (j = 0; j < len; j++) blist[j] = new bloc(str[j]); keyl[0] = key; }
public blmat(byte[] b) { len = 1; blist = new bloc[len]; blist[0] = new bloc(b); keyl[0] = key; }
public void invaddRKey(bloc bl, int cnt) { for (int c = 0; c < 4; c++) { for (int l = 0; l < 4; l++) { bl.retbl()[l, c] = (byte)(bl.retbl()[l, c] ^ keyl[cnt + 1][l, c]); } } }
public blmat(byte[] b) { len = b.Length / 16; blist = new bloc[len]; byte[] c = new byte[16]; for (int cnt = 0; cnt < len; cnt++) for (int i = 0; i < 16; i++) { c[i] = b[cnt * 16 + i]; blist[cnt] = new bloc(c); } keyl[0] = key; }
public blmat(byte[] b) { len = b.Length / 16; blist = new bloc[len]; byte[] c = new byte[16]; for (int cnt = 0; cnt < len; cnt++) { for (int i = 0; i < 16; i++) { c[i] = b[cnt * 16 + i]; blist[cnt] = new bloc(c); } } keyl[0] = key; }
public blmat(String s) { int n, j, i = 0; n = s.Length / 16; String[] str; nBl = (16 - (s.Length % 16));//asd if (s.Length % 16 != 0) { i = 1; str = new String[n + 1]; } else { str = new String[n]; } for (j = 0; j < n; j++) { str[j] = s.Substring(j * 16, 16); } if (i == 1) { str[n] = s.Substring(j * 16, s.Length - j * 16) + (new String('\v', (16 - (s.Length - j * 16)))); len = n + 1; } else { len = n; } blist = new bloc[len]; for (j = 0; j < len; j++) { blist[j] = new bloc(str[j]); } keyl[0] = key; }
public void addRKey(bloc bl, int cnt) { for (int c = 0; c < 4; c++) for (int l = 0; l < 4; l++) bl.retbl()[l, c] = (byte)(bl.retbl()[l, c] ^ keyl[cnt+1][l, c]); }