private void gCTRBlock(byte[] block, byte[] out, int outOff) { byte[] tmp = getNextCounterBlock(); GCMUtil.xor(tmp, block); System.arraycopy(tmp, 0, out, outOff, BLOCK_SIZE); gHASHBlock(S, forEncryption ? tmp : block); totalLength += BLOCK_SIZE; }
private void gCTRPartial(byte[] buf, int off, int len, byte[] out, int outOff) { byte[] tmp = getNextCounterBlock(); GCMUtil.xor(tmp, buf, off, len); System.arraycopy(tmp, 0, out, outOff, len); gHASHPartial(S, forEncryption ? tmp : buf, 0, len); totalLength += len; }