private static byte[][][] reverseSubKeys(byte[][][] subKeys) {
        byte[][][] reversedSubKeys = new byte[subKeys.length][][];
        for (int i = 0; i < subKeys.length; i++) {
            int reversedI = subKeys.length - 1 - i;
            reversedSubKeys[reversedI] = new byte[subKeys[i].length][];
            for (int j = 0; j < subKeys[i].length; j++) {
                int reversedJ = subKeys[i].length - 1 - j;
                reversedSubKeys[reversedI][reversedJ] = subKeys[i][j];
            }
        }
        return reversedSubKeys;
    }