private int encryptBlock(byte[] in,int inOff,byte[] out,int outOff) throws DataLengthException, IllegalStateException {
  if ((inOff + blockSize) > in.length) {
    throw new DataLengthException("input buffer too short");
  }
  for (int i=0; i < blockSize; i++) {
    cbcV[i]^=in[inOff + i];
  }
  int length=cipher.processBlock(cbcV,0,out,outOff);
  System.arraycopy(out,outOff,cbcV,0,cbcV.length);
  return length;
}

private int encryptBlock ( byte [ ] in , int inOff , byte [ ] out , int outOff ) throws DataLengthException , IllegalStateException { if ( ( inOff + blockSize ) > in . length ) { throw new DataLengthException ( "input buffer too short" ) ; } for ( int i = 0 ; i < blockSize ; i ++ ) { cbcV [ i ] ^= in [ inOff + i ] ; } int length = cipher . processBlock ( cbcV , 0 , out , outOff ) ; System . arraycopy ( out , outOff , cbcV , 0 , cbcV . length ) ; return length ; }
do the appropriate chaining step for cbc mode encryption .
