private static void set3(IBlockCipher cipher, int keySize) throws InvalidKeyException {
   String s;
   int kl = keySize / 8;
   int bl = cipher.defaultBlockSize();
   byte[] k = new byte[kl];
   byte[] p = new byte[bl];
   byte[] c = new byte[bl];
   byte[] d = new byte[bl];
   int j;
   System.out.println("Test vectors -- set 3");
   System.out.println("=====================");
   System.out.println();
   cipher.reset();
   HashMap map = new HashMap();
   for (int i = 0; i < 256; i++) {
     s = "   " + String.valueOf(i);
     s = s.substring(s.length() - 3);
     System.out.println("Set 3, vector#" + s + ":");
     for (j = 0; j < bl; j++) {
       k[j] = (byte) i;
       p[j] = (byte) i;
     }
     for (; j < kl; j++) {
       k[j] = (byte) i;
     }
     map.put(IBlockCipher.KEY_MATERIAL, k);
     cipher.init(map);
     System.out.println("                      key=" + Util.toString(k));
     System.out.println("                    plain=" + Util.toString(p));
     cipher.encryptBlock(p, 0, c, 0);
     System.out.println("                   cipher=" + Util.toString(c));
     cipher.decryptBlock(c, 0, d, 0);
     System.out.println("                decrypted=" + Util.toString(d));
     if (!Arrays.equals(p, d)) {
       throw new RuntimeException("Symmetric operation failure...");
     }
     for (j = 1; j < 100; j++) {
       cipher.encryptBlock(c, 0, c, 0);
     }
     System.out.println("       Iterated 100 times=" + Util.toString(c));
     for (j = 100; j < 1000; j++) {
       cipher.encryptBlock(c, 0, c, 0);
     }
     System.out.println("      Iterated 1000 times=" + Util.toString(c));
     System.out.println();
     cipher.reset();
   }
 }