NBitcoin.BouncyCastle.Crypto.Digests.GeneralDigest.BlockUpdate C# (CSharp) Method

BlockUpdate() public method

public BlockUpdate ( byte input, int inOff, int length ) : void
input byte
inOff int
length int
return void
		public void BlockUpdate(
			byte[] input,
			int inOff,
			int length)
		{
			length = System.Math.Max(0, length);

			//
			// fill the current word
			//
			int i = 0;
			if(xBufOff != 0)
			{
				while(i < length)
				{
					xBuf[xBufOff++] = input[inOff + i++];
					if(xBufOff == 4)
					{
						ProcessWord(xBuf, 0);
						xBufOff = 0;
						break;
					}
				}
			}

			//
			// process whole words.
			//
			int limit = ((length - i) & ~3) + i;
			for(; i < limit; i += 4)
			{
				ProcessWord(input, inOff + i);
			}

			//
			// load in the remainder.
			//
			while(i < length)
			{
				xBuf[xBufOff++] = input[inOff + i++];
			}

			byteCount += length;
		}