2019-11-20 03:05:33 +01:00
|
|
|
|
using System;
|
|
|
|
|
using LibHac.Crypto;
|
2019-11-09 08:32:13 +01:00
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace LibHac.Tests.CryptoTests
|
|
|
|
|
{
|
|
|
|
|
internal static class Common
|
|
|
|
|
{
|
|
|
|
|
internal static void CipherTestCore(byte[] inputData, byte[] expected, ICipher cipher)
|
|
|
|
|
{
|
2019-11-20 03:05:33 +01:00
|
|
|
|
var transformBuffer = new byte[inputData.Length];
|
|
|
|
|
Buffer.BlockCopy(inputData, 0, transformBuffer, 0, inputData.Length);
|
2019-11-09 08:32:13 +01:00
|
|
|
|
|
2019-11-20 03:05:33 +01:00
|
|
|
|
cipher.Transform(transformBuffer, transformBuffer);
|
2019-11-09 08:32:13 +01:00
|
|
|
|
|
2019-11-20 03:05:33 +01:00
|
|
|
|
Assert.Equal(expected, transformBuffer);
|
2019-11-09 08:32:13 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|