LibHac/tests/LibHac.Tests/CryptoTests/AesCtrTests.cs

25 lines
762 B
C#
Raw Normal View History

2019-11-09 08:32:13 +01:00
using LibHac.Crypto2;
using Xunit;
namespace LibHac.Tests.CryptoTests
{
public class AesCtrTests
{
public static TheoryData<EncryptionTestVector> TestVectors = RspReader.ReadTestVectors(true, "CTR128.rsp");
[Theory]
[MemberData(nameof(TestVectors))]
public static void Transform(EncryptionTestVector tv)
{
2019-11-19 02:20:21 +01:00
Common.CipherTestCore(tv.PlainText, tv.CipherText, Aes.CreateCtrEncryptor(tv.Key, tv.Iv, true));
2019-11-09 08:32:13 +01:00
}
[AesIntrinsicsRequiredTheory]
[MemberData(nameof(TestVectors))]
public static void TransformIntrinsics(EncryptionTestVector tv)
{
2019-11-19 02:20:21 +01:00
Common.CipherTestCore(tv.PlainText, tv.CipherText, Aes.CreateCtrEncryptor(tv.Key, tv.Iv));
2019-11-09 08:32:13 +01:00
}
}
}