Org.BouncyCastle.Crypto.Digests.Gost3411Digest.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)
		{
			while ((xBufOff != 0) && (length > 0))
			{
				Update(input[inOff]);
				inOff++;
				length--;
			}

			while (length > xBuf.Length)
			{
				Array.Copy(input, inOff, xBuf, 0, xBuf.Length);

				sumByteArray(xBuf); // calc sum M
				processBlock(xBuf, 0);
				inOff += xBuf.Length;
				length -= xBuf.Length;
				byteCount += xBuf.Length;
			}

			// load in the remainder.
			while (length > 0)
			{
				Update(input[inOff]);
				inOff++;
				length--;
			}
		}

Usage Example

コード例 #1
0
ファイル: User.cs プロジェクト: Dekkee/LavaAxe
        public bool verifyPassword(string Password)
        {
            this.Password = Password;

            byte[] password = Utility.StringToByteArray(this.Password);
            Gost3411Digest digest = new Gost3411Digest();
            SecureRandom random = new SecureRandom();
            byte[] salt = random.GenerateSeed(16);
            digest.BlockUpdate(password, 0, password.Length);
            digest.BlockUpdate(salt, 0, 16);
            byte[] hash = new byte[digest.GetDigestSize()];
            digest.DoFinal(hash, 0);

            return true;
        }
All Usage Examples Of Org.BouncyCastle.Crypto.Digests.Gost3411Digest::BlockUpdate