public EncryptBlock ( byte inputBuffer, int inputOffset, int inputCount, byte outputBuffer, int outputOffset ) : int | ||
inputBuffer | byte | The input data to encrypt. |
inputOffset | int | The offset into the input byte array from which to begin using data. |
inputCount | int | The number of bytes in the input byte array to use as data. |
outputBuffer | byte | The output to which to write encrypted data. |
outputOffset | int | The offset into the output byte array from which to begin writing data. |
return | int |
public override int EncryptBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
{
if (inputBuffer == null)
throw new ArgumentNullException("inputBuffer");
if (outputBuffer == null)
throw new ArgumentNullException("outputBuffer");
if ((inputOffset + (32 / 2)) > inputBuffer.Length)
{
throw new IndexOutOfRangeException("input buffer too short");
}
if ((outputOffset + (32 / 2)) > outputBuffer.Length)
{
throw new IndexOutOfRangeException("output buffer too short");
}
if (_encryptionKey == null)
{
_encryptionKey = GenerateWorkingKey(true, Key);
}
UnPackBlock(inputBuffer, inputOffset);
EncryptBlock(_encryptionKey);
PackBlock(outputBuffer, outputOffset);
return BlockSize;
}
AesCipher::EncryptBlock ( uint KW ) : void |
public void EncryptBlockTest() { byte[] key = null; // TODO: Initialize to an appropriate value CipherMode mode = null; // TODO: Initialize to an appropriate value CipherPadding padding = null; // TODO: Initialize to an appropriate value AesCipher target = new AesCipher(key, mode, padding); // TODO: Initialize to an appropriate value byte[] inputBuffer = null; // TODO: Initialize to an appropriate value int inputOffset = 0; // TODO: Initialize to an appropriate value int inputCount = 0; // TODO: Initialize to an appropriate value byte[] outputBuffer = null; // TODO: Initialize to an appropriate value int outputOffset = 0; // TODO: Initialize to an appropriate value int expected = 0; // TODO: Initialize to an appropriate value int actual; actual = target.EncryptBlock(inputBuffer, inputOffset, inputCount, outputBuffer, outputOffset); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }