Org.BouncyCastle.Crypto.Prng.DigestRandomGenerator.NextBytes C# (CSharp) Method

NextBytes() public method

public NextBytes ( byte bytes ) : void
bytes byte
return void
		public void NextBytes(
			byte[] bytes)
		{
			NextBytes(bytes, 0, bytes.Length);
		}

Same methods

DigestRandomGenerator::NextBytes ( byte bytes, int start, int len ) : void

Usage Example

コード例 #1
0
		private void doExpectedTest(IDigest digest, int seed, byte[] expected, byte[] noCycle)
		{
			DigestRandomGenerator rGen = new DigestRandomGenerator(digest);
			byte[] output = new byte[digest.GetDigestSize()];

			rGen.AddSeedMaterial(seed);

			for (int i = 0; i != 1024; i++)
			{
				rGen.NextBytes(output);
			}

			if (noCycle != null)
			{
				if (Arrays.AreEqual(noCycle, output))
				{
					Fail("seed not being cycled!");
				}
			}

			if (!Arrays.AreEqual(expected, output))
			{
				Fail("expected output doesn't match");
			}
		}
All Usage Examples Of Org.BouncyCastle.Crypto.Prng.DigestRandomGenerator::NextBytes