mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
24 lines
774 B
C#
24 lines
774 B
C#
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)
|
|
{
|
|
Common.CipherTestCore(tv.PlainText, tv.CipherText, AesCrypto.CreateCtrEncryptor(tv.Key, tv.Iv, true));
|
|
}
|
|
|
|
[AesIntrinsicsRequiredTheory]
|
|
[MemberData(nameof(TestVectors))]
|
|
public static void TransformIntrinsics(EncryptionTestVector tv)
|
|
{
|
|
Common.CipherTestCore(tv.PlainText, tv.CipherText, AesCrypto.CreateCtrEncryptor(tv.Key, tv.Iv));
|
|
}
|
|
}
|
|
}
|