ProcessBlock() public method

public ProcessBlock ( byte input, int inOff, byte output, int outOff ) : int
input byte
inOff int
output byte
outOff int
return int
Ejemplo n.º 1
0
		public static long CheckBCRijndael ()
		{
			CheckFirstCall ();
			long after, before = GC.GetTotalMemory (true);

			IBlockCipher cipher = new CbcBlockCipher(new AesFastEngine ());
			cipher.Init(true, new ParametersWithIV(new KeyParameter(_key), _iv));
			cipher.ProcessBlock (_input, 0, _output, 0);
			after = GC.GetTotalMemory (true);
			cipher.ProcessBlock (_input, 0, _output, 0);

			return after - before;
		}
Ejemplo n.º 2
0
		private void encryptBlock(byte[] key, byte[] iv, byte[] cekBlock)
		{
			IBlockCipher engine = new CbcBlockCipher(new DesEngine());

			engine.Init(true, new ParametersWithIV(new KeyParameter(key), iv));

			for (int i = 0; i < cekBlock.Length; i += 8)
			{
				engine.ProcessBlock(cekBlock, i, cekBlock, i);
			}

			for (int i = 0; i < cekBlock.Length; i += 8)
			{
				engine.ProcessBlock(cekBlock, i, cekBlock, i);
			}
		}