private boolean testSymmetry(int ks, int bs) {
      try {
         IMode mode = (IMode) this.clone();
         byte[] iv = new byte[cipherBlockSize]; // all zeroes
         byte[] k = new byte[ks];
         int i;
         for (i = 0; i < ks; i++) {
            k[i] = (byte) i;
         }

         int blockCount = 5;
         int limit = blockCount * bs;
         byte[] pt = new byte[limit];
         for (i = 0; i < limit; i++) {
            pt[i] = (byte) i;
         }
         byte[] ct = new byte[limit];
         byte[] cpt = new byte[limit];

         Map map = new HashMap();
         map.put(KEY_MATERIAL, k);
         map.put(CIPHER_BLOCK_SIZE, new Integer(bs));
         map.put(STATE, new Integer(ENCRYPTION));
         map.put(IV, iv);
         map.put(MODE_BLOCK_SIZE, new Integer(bs));

         mode.reset();
         mode.init(map);
         for (i = 0; i < blockCount; i++) {
            mode.update(pt, i * bs, ct, i * bs);
         }

         mode.reset();
         map.put(STATE, new Integer(DECRYPTION));
         mode.init(map);
         for (i = 0; i < blockCount; i++) {
            mode.update(ct, i * bs, cpt, i * bs);
         }

         return Arrays.equals(pt, cpt);

      } catch (Exception x) {
         x.printStackTrace(System.err);
         return false;
      }
   }