public boolean selfTest() {
      byte[] padBytes;
      final int offset = 5;
      final int limit = 1024;
      final byte[] in = new byte[limit];
      for (int bs = 2; bs < 256; bs++) {
         this.init(bs);
         for (int i = 0; i < limit-offset-blockSize; i++) {
            padBytes = pad(in, offset, i);
            if (((i + padBytes.length) % blockSize) != 0) {
               new RuntimeException(name()).printStackTrace(System.err);
               return false;
            }

            System.arraycopy(padBytes, 0, in, offset+i, padBytes.length);
            try {
               if (padBytes.length != unpad(in, offset, i+padBytes.length)) {
                  new RuntimeException(name()).printStackTrace(System.err);
                  return false;
               }
            } catch (WrongPaddingException x) {
               x.printStackTrace(System.err);
               return false;
            }
         }
         this.reset();
      }

      return true;
   }