mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Use AES-NI instructions
This commit is contained in:
parent
f99bc3e0fe
commit
df27d2a83b
30 changed files with 7757 additions and 33 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -263,3 +263,5 @@ __pycache__/
|
||||||
|
|
||||||
|
|
||||||
global.json
|
global.json
|
||||||
|
|
||||||
|
!tests/LibHac.Tests/CryptoTests/TestVectors/*
|
81
src/LibHac/Crypto2/Aes.cs
Normal file
81
src/LibHac/Crypto2/Aes.cs
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
#if HAS_INTRINSICS
|
||||||
|
using System.Runtime.Intrinsics.X86;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace LibHac.Crypto2
|
||||||
|
{
|
||||||
|
public static class AesCrypto
|
||||||
|
{
|
||||||
|
public static bool IsAesNiSupported()
|
||||||
|
{
|
||||||
|
#if HAS_INTRINSICS
|
||||||
|
return Aes.IsSupported;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ICipher CreateEcbDecryptor(ReadOnlySpan<byte> key, bool preferDotNetCrypto = false)
|
||||||
|
{
|
||||||
|
#if HAS_INTRINSICS
|
||||||
|
if (IsAesNiSupported() && !preferDotNetCrypto)
|
||||||
|
{
|
||||||
|
return new AesEcbDecryptorHw(key);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return new AesEcbDecryptor(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ICipher CreateEcbEncryptor(ReadOnlySpan<byte> key, bool preferDotNetCrypto = false)
|
||||||
|
{
|
||||||
|
#if HAS_INTRINSICS
|
||||||
|
if (IsAesNiSupported() && !preferDotNetCrypto)
|
||||||
|
{
|
||||||
|
return new AesEcbEncryptorHw(key);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return new AesEcbEncryptor(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ICipher CreateCbcDecryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv, bool preferDotNetCrypto = false)
|
||||||
|
{
|
||||||
|
#if HAS_INTRINSICS
|
||||||
|
if (IsAesNiSupported() && !preferDotNetCrypto)
|
||||||
|
{
|
||||||
|
return new AesCbcDecryptorHw(key, iv);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return new AesCbcDecryptor(key, iv);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ICipher CreateCbcEncryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv, bool preferDotNetCrypto = false)
|
||||||
|
{
|
||||||
|
#if HAS_INTRINSICS
|
||||||
|
if (IsAesNiSupported() && !preferDotNetCrypto)
|
||||||
|
{
|
||||||
|
return new AesCbcEncryptorHw(key, iv);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return new AesCbcEncryptor(key, iv);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ICipher CreateCtrDecryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv, bool preferDotNetCrypto = false)
|
||||||
|
{
|
||||||
|
// Encryption and decryption in counter mode is the same operation
|
||||||
|
return CreateCtrEncryptor(key, iv, preferDotNetCrypto);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ICipher CreateCtrEncryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv, bool preferDotNetCrypto = false)
|
||||||
|
{
|
||||||
|
#if HAS_INTRINSICS
|
||||||
|
if (IsAesNiSupported() && !preferDotNetCrypto)
|
||||||
|
{
|
||||||
|
return new AesCtrEncryptorHw(key, iv);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return new AesCtrEncryptor(key, iv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
59
src/LibHac/Crypto2/AesCbcMode.cs
Normal file
59
src/LibHac/Crypto2/AesCbcMode.cs
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
using System;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
|
namespace LibHac.Crypto2
|
||||||
|
{
|
||||||
|
public class AesCbcEncryptor : ICipher
|
||||||
|
{
|
||||||
|
private ICryptoTransform _encryptor;
|
||||||
|
|
||||||
|
public AesCbcEncryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv)
|
||||||
|
{
|
||||||
|
Aes aes = Aes.Create();
|
||||||
|
|
||||||
|
if (aes == null) throw new CryptographicException("Unable to create AES object");
|
||||||
|
aes.Key = key.ToArray();
|
||||||
|
aes.IV = iv.ToArray();
|
||||||
|
aes.Mode = CipherMode.CBC;
|
||||||
|
aes.Padding = PaddingMode.None;
|
||||||
|
|
||||||
|
_encryptor = aes.CreateEncryptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
var outputBuffer = new byte[input.Length];
|
||||||
|
|
||||||
|
_encryptor.TransformBlock(input.ToArray(), 0, input.Length, outputBuffer, 0);
|
||||||
|
|
||||||
|
outputBuffer.CopyTo(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AesCbcDecryptor : ICipher
|
||||||
|
{
|
||||||
|
private ICryptoTransform _decryptor;
|
||||||
|
|
||||||
|
public AesCbcDecryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv)
|
||||||
|
{
|
||||||
|
Aes aes = Aes.Create();
|
||||||
|
|
||||||
|
if (aes == null) throw new CryptographicException("Unable to create AES object");
|
||||||
|
aes.Key = key.ToArray();
|
||||||
|
aes.IV = iv.ToArray();
|
||||||
|
aes.Mode = CipherMode.CBC;
|
||||||
|
aes.Padding = PaddingMode.None;
|
||||||
|
|
||||||
|
_decryptor = aes.CreateDecryptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
var outputBuffer = new byte[input.Length];
|
||||||
|
|
||||||
|
_decryptor.TransformBlock(input.ToArray(), 0, input.Length, outputBuffer, 0);
|
||||||
|
|
||||||
|
outputBuffer.CopyTo(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
105
src/LibHac/Crypto2/AesCbcModeHw.cs
Normal file
105
src/LibHac/Crypto2/AesCbcModeHw.cs
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
#if HAS_INTRINSICS
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.Intrinsics;
|
||||||
|
using System.Runtime.Intrinsics.X86;
|
||||||
|
|
||||||
|
namespace LibHac.Crypto2
|
||||||
|
{
|
||||||
|
public struct AesCbcEncryptorHw : ICipher
|
||||||
|
{
|
||||||
|
private AesCoreNi _aesCore;
|
||||||
|
private Vector128<byte> _iv;
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||||
|
public AesCbcEncryptorHw(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv)
|
||||||
|
{
|
||||||
|
_aesCore = new AesCoreNi();
|
||||||
|
_aesCore.Initialize(key, false);
|
||||||
|
|
||||||
|
_iv = Unsafe.ReadUnaligned<Vector128<byte>>(ref MemoryMarshal.GetReference(iv));
|
||||||
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||||
|
public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
ReadOnlySpan<Vector128<byte>> keys = _aesCore.RoundKeys;
|
||||||
|
ReadOnlySpan<Vector128<byte>> inBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(input);
|
||||||
|
Span<Vector128<byte>> outBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(output);
|
||||||
|
|
||||||
|
Vector128<byte> b = _iv;
|
||||||
|
|
||||||
|
for (int i = 0; i < inBlocks.Length; i++)
|
||||||
|
{
|
||||||
|
b = Sse2.Xor(b, inBlocks[i]);
|
||||||
|
|
||||||
|
b = Sse2.Xor(b, keys[0]);
|
||||||
|
b = Aes.Encrypt(b, keys[1]);
|
||||||
|
b = Aes.Encrypt(b, keys[2]);
|
||||||
|
b = Aes.Encrypt(b, keys[3]);
|
||||||
|
b = Aes.Encrypt(b, keys[4]);
|
||||||
|
b = Aes.Encrypt(b, keys[5]);
|
||||||
|
b = Aes.Encrypt(b, keys[6]);
|
||||||
|
b = Aes.Encrypt(b, keys[7]);
|
||||||
|
b = Aes.Encrypt(b, keys[8]);
|
||||||
|
b = Aes.Encrypt(b, keys[9]);
|
||||||
|
b = Aes.EncryptLast(b, keys[10]);
|
||||||
|
|
||||||
|
outBlocks[i] = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
_iv = b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct AesCbcDecryptorHw : ICipher
|
||||||
|
{
|
||||||
|
private AesCoreNi _aesCore;
|
||||||
|
private Vector128<byte> _iv;
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||||
|
public AesCbcDecryptorHw(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv)
|
||||||
|
{
|
||||||
|
_aesCore = new AesCoreNi();
|
||||||
|
_aesCore.Initialize(key, true);
|
||||||
|
|
||||||
|
_iv = Unsafe.ReadUnaligned<Vector128<byte>>(ref MemoryMarshal.GetReference(iv));
|
||||||
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||||
|
public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
ReadOnlySpan<Vector128<byte>> keys = _aesCore.RoundKeys;
|
||||||
|
ReadOnlySpan<Vector128<byte>> inBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(input);
|
||||||
|
Span<Vector128<byte>> outBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(output);
|
||||||
|
|
||||||
|
Vector128<byte> iv = _iv;
|
||||||
|
|
||||||
|
for (int i = 0; i < inBlocks.Length; i++)
|
||||||
|
{
|
||||||
|
Vector128<byte> b = inBlocks[i];
|
||||||
|
Vector128<byte> nextIv = b;
|
||||||
|
|
||||||
|
b = Sse2.Xor(b, keys[10]);
|
||||||
|
b = Aes.Decrypt(b, keys[9]);
|
||||||
|
b = Aes.Decrypt(b, keys[8]);
|
||||||
|
b = Aes.Decrypt(b, keys[7]);
|
||||||
|
b = Aes.Decrypt(b, keys[6]);
|
||||||
|
b = Aes.Decrypt(b, keys[5]);
|
||||||
|
b = Aes.Decrypt(b, keys[4]);
|
||||||
|
b = Aes.Decrypt(b, keys[3]);
|
||||||
|
b = Aes.Decrypt(b, keys[2]);
|
||||||
|
b = Aes.Decrypt(b, keys[1]);
|
||||||
|
b = Aes.DecryptLast(b, keys[0]);
|
||||||
|
|
||||||
|
b = Sse2.Xor(b, iv);
|
||||||
|
iv = nextIv;
|
||||||
|
outBlocks[i] = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
_iv = iv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
122
src/LibHac/Crypto2/AesCoreNi.cs
Normal file
122
src/LibHac/Crypto2/AesCoreNi.cs
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
#if NETCOREAPP
|
||||||
|
using System;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Runtime.Intrinsics;
|
||||||
|
using System.Runtime.Intrinsics.X86;
|
||||||
|
|
||||||
|
namespace LibHac.Crypto2
|
||||||
|
{
|
||||||
|
[StructLayout(LayoutKind.Sequential, Size = RoundKeyCount * RoundKeySize)]
|
||||||
|
public struct AesCoreNi
|
||||||
|
{
|
||||||
|
private const int RoundKeyCount = 11;
|
||||||
|
private const int RoundKeySize = 0x10;
|
||||||
|
|
||||||
|
private Vector128<byte> _roundKeys;
|
||||||
|
|
||||||
|
public void Initialize(ReadOnlySpan<byte> key, bool isDecrypting)
|
||||||
|
{
|
||||||
|
KeyExpansion(key, RoundKeys, isDecrypting);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Span<Vector128<byte>> RoundKeys =>
|
||||||
|
MemoryMarshal.CreateSpan(ref _roundKeys, RoundKeyCount);
|
||||||
|
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||||
|
public void Encrypt(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
ReadOnlySpan<Vector128<byte>> keys = RoundKeys;
|
||||||
|
ReadOnlySpan<Vector128<byte>> inBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(input);
|
||||||
|
Span<Vector128<byte>> outBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(output);
|
||||||
|
|
||||||
|
for (int i = 0; i < inBlocks.Length; i++)
|
||||||
|
{
|
||||||
|
Vector128<byte> b = inBlocks[i];
|
||||||
|
|
||||||
|
b = Sse2.Xor(b, keys[0]);
|
||||||
|
b = Aes.Encrypt(b, keys[1]);
|
||||||
|
b = Aes.Encrypt(b, keys[2]);
|
||||||
|
b = Aes.Encrypt(b, keys[3]);
|
||||||
|
b = Aes.Encrypt(b, keys[4]);
|
||||||
|
b = Aes.Encrypt(b, keys[5]);
|
||||||
|
b = Aes.Encrypt(b, keys[6]);
|
||||||
|
b = Aes.Encrypt(b, keys[7]);
|
||||||
|
b = Aes.Encrypt(b, keys[8]);
|
||||||
|
b = Aes.Encrypt(b, keys[9]);
|
||||||
|
b = Aes.EncryptLast(b, keys[10]);
|
||||||
|
|
||||||
|
outBlocks[i] = b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||||
|
public void Decrypt(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
ReadOnlySpan<Vector128<byte>> keys = RoundKeys;
|
||||||
|
ReadOnlySpan<Vector128<byte>> inBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(input);
|
||||||
|
Span<Vector128<byte>> outBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(output);
|
||||||
|
|
||||||
|
for (int i = 0; i < inBlocks.Length; i++)
|
||||||
|
{
|
||||||
|
Vector128<byte> b = inBlocks[i];
|
||||||
|
|
||||||
|
b = Sse2.Xor(b, keys[10]);
|
||||||
|
b = Aes.Decrypt(b, keys[9]);
|
||||||
|
b = Aes.Decrypt(b, keys[8]);
|
||||||
|
b = Aes.Decrypt(b, keys[7]);
|
||||||
|
b = Aes.Decrypt(b, keys[6]);
|
||||||
|
b = Aes.Decrypt(b, keys[5]);
|
||||||
|
b = Aes.Decrypt(b, keys[4]);
|
||||||
|
b = Aes.Decrypt(b, keys[3]);
|
||||||
|
b = Aes.Decrypt(b, keys[2]);
|
||||||
|
b = Aes.Decrypt(b, keys[1]);
|
||||||
|
b = Aes.DecryptLast(b, keys[0]);
|
||||||
|
|
||||||
|
outBlocks[i] = b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||||
|
private static void KeyExpansion(ReadOnlySpan<byte> key, Span<Vector128<byte>> roundKeys, bool isDecrypting)
|
||||||
|
{
|
||||||
|
roundKeys[0] = Unsafe.ReadUnaligned<Vector128<byte>>(ref MemoryMarshal.GetReference(key));
|
||||||
|
|
||||||
|
MakeRoundKey(roundKeys, 1, 0x01);
|
||||||
|
MakeRoundKey(roundKeys, 2, 0x02);
|
||||||
|
MakeRoundKey(roundKeys, 3, 0x04);
|
||||||
|
MakeRoundKey(roundKeys, 4, 0x08);
|
||||||
|
MakeRoundKey(roundKeys, 5, 0x10);
|
||||||
|
MakeRoundKey(roundKeys, 6, 0x20);
|
||||||
|
MakeRoundKey(roundKeys, 7, 0x40);
|
||||||
|
MakeRoundKey(roundKeys, 8, 0x80);
|
||||||
|
MakeRoundKey(roundKeys, 9, 0x1b);
|
||||||
|
MakeRoundKey(roundKeys, 10, 0x36);
|
||||||
|
|
||||||
|
if (isDecrypting)
|
||||||
|
{
|
||||||
|
for (int i = 1; i < 10; i++)
|
||||||
|
{
|
||||||
|
roundKeys[i] = Aes.InverseMixColumns(roundKeys[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||||
|
private static void MakeRoundKey(Span<Vector128<byte>> keys, int i, byte rcon)
|
||||||
|
{
|
||||||
|
Vector128<byte> s = keys[i - 1];
|
||||||
|
Vector128<byte> t = keys[i - 1];
|
||||||
|
|
||||||
|
t = Aes.KeygenAssist(t, rcon);
|
||||||
|
t = Sse2.Shuffle(t.AsUInt32(), 0xFF).AsByte();
|
||||||
|
|
||||||
|
s = Sse2.Xor(s, Sse2.ShiftLeftLogical128BitLane(s, 4));
|
||||||
|
s = Sse2.Xor(s, Sse2.ShiftLeftLogical128BitLane(s, 8));
|
||||||
|
|
||||||
|
keys[i] = Sse2.Xor(s, t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
69
src/LibHac/Crypto2/AesCtrMode.cs
Normal file
69
src/LibHac/Crypto2/AesCtrMode.cs
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
using System;
|
||||||
|
using System.Buffers;
|
||||||
|
using System.Buffers.Binary;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
|
namespace LibHac.Crypto2
|
||||||
|
{
|
||||||
|
public class AesCtrEncryptor : ICipher
|
||||||
|
{
|
||||||
|
private const int BlockSize = 128;
|
||||||
|
private const int BlockSizeBytes = BlockSize / 8;
|
||||||
|
|
||||||
|
private readonly ICryptoTransform _encryptor;
|
||||||
|
private readonly byte[] _counter = new byte[0x10];
|
||||||
|
|
||||||
|
public AesCtrEncryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv)
|
||||||
|
{
|
||||||
|
Aes aes = Aes.Create();
|
||||||
|
if (aes == null) throw new CryptographicException("Unable to create AES object");
|
||||||
|
|
||||||
|
aes.Mode = CipherMode.ECB;
|
||||||
|
aes.Padding = PaddingMode.None;
|
||||||
|
|
||||||
|
_encryptor = aes.CreateEncryptor(key.ToArray(), new byte[0x10]);
|
||||||
|
|
||||||
|
iv.CopyTo(_counter);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
int blockCount = Util.DivideByRoundUp(input.Length, BlockSizeBytes);
|
||||||
|
int length = blockCount * BlockSizeBytes;
|
||||||
|
|
||||||
|
byte[] counterXor = ArrayPool<byte>.Shared.Rent(length);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FillDecryptedCounter(_counter, counterXor.AsSpan(0, length));
|
||||||
|
|
||||||
|
_encryptor.TransformBlock(counterXor, 0, length, counterXor, 0);
|
||||||
|
|
||||||
|
input.CopyTo(output);
|
||||||
|
Util.XorArrays(output, counterXor);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
ArrayPool<byte>.Shared.Return(counterXor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void FillDecryptedCounter(Span<byte> counter, Span<byte> buffer)
|
||||||
|
{
|
||||||
|
Span<ulong> bufL = MemoryMarshal.Cast<byte, ulong>(buffer);
|
||||||
|
Span<ulong> counterL = MemoryMarshal.Cast<byte, ulong>(counter);
|
||||||
|
|
||||||
|
ulong hi = counterL[0];
|
||||||
|
ulong lo = BinaryPrimitives.ReverseEndianness(counterL[1]);
|
||||||
|
|
||||||
|
for (int i = 0; i < bufL.Length; i += 2)
|
||||||
|
{
|
||||||
|
bufL[i] = hi;
|
||||||
|
bufL[i + 1] = BinaryPrimitives.ReverseEndianness(lo);
|
||||||
|
lo++;
|
||||||
|
}
|
||||||
|
|
||||||
|
counterL[1] = BinaryPrimitives.ReverseEndianness(lo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
84
src/LibHac/Crypto2/AesCtrModeHw.cs
Normal file
84
src/LibHac/Crypto2/AesCtrModeHw.cs
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
#if HAS_INTRINSICS
|
||||||
|
using System;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Runtime.Intrinsics;
|
||||||
|
using System.Runtime.Intrinsics.X86;
|
||||||
|
|
||||||
|
namespace LibHac.Crypto2
|
||||||
|
{
|
||||||
|
public class AesCtrEncryptorHw : ICipher
|
||||||
|
{
|
||||||
|
private AesCoreNi _aesCore;
|
||||||
|
private Vector128<byte> _iv;
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||||
|
public AesCtrEncryptorHw(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv)
|
||||||
|
{
|
||||||
|
_aesCore = new AesCoreNi();
|
||||||
|
_aesCore.Initialize(key, false);
|
||||||
|
|
||||||
|
_iv = Unsafe.ReadUnaligned<Vector128<byte>>(ref MemoryMarshal.GetReference(iv));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
ReadOnlySpan<Vector128<byte>> keys = _aesCore.RoundKeys;
|
||||||
|
ReadOnlySpan<Vector128<byte>> inBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(input);
|
||||||
|
Span<Vector128<byte>> outBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(output);
|
||||||
|
|
||||||
|
Vector128<byte> byteSwapMask = Vector128.Create((ulong)0x706050403020100, 0x8090A0B0C0D0E0F).AsByte();
|
||||||
|
Vector128<ulong> inc = Vector128.Create((ulong)0, 1);
|
||||||
|
|
||||||
|
var iv = _iv;
|
||||||
|
Vector128<ulong> bSwappedIv = Ssse3.Shuffle(iv, byteSwapMask).AsUInt64();
|
||||||
|
|
||||||
|
for (int i = 0; i < inBlocks.Length; i++)
|
||||||
|
{
|
||||||
|
Vector128<byte> b = Sse2.Xor(iv, keys[0]);
|
||||||
|
b = Aes.Encrypt(b, keys[1]);
|
||||||
|
b = Aes.Encrypt(b, keys[2]);
|
||||||
|
b = Aes.Encrypt(b, keys[3]);
|
||||||
|
b = Aes.Encrypt(b, keys[4]);
|
||||||
|
b = Aes.Encrypt(b, keys[5]);
|
||||||
|
b = Aes.Encrypt(b, keys[6]);
|
||||||
|
b = Aes.Encrypt(b, keys[7]);
|
||||||
|
b = Aes.Encrypt(b, keys[8]);
|
||||||
|
b = Aes.Encrypt(b, keys[9]);
|
||||||
|
b = Aes.EncryptLast(b, keys[10]);
|
||||||
|
|
||||||
|
outBlocks[i] = Sse2.Xor(inBlocks[i], b);
|
||||||
|
|
||||||
|
// Increase the counter
|
||||||
|
bSwappedIv = Sse2.Add(bSwappedIv, inc);
|
||||||
|
iv = Ssse3.Shuffle(bSwappedIv.AsByte(), byteSwapMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
_iv = iv;
|
||||||
|
|
||||||
|
if ((input.Length & 0xF) != 0)
|
||||||
|
{
|
||||||
|
EncryptCtrPartialBlock(input.Slice(inBlocks.Length * 0x10), output.Slice(outBlocks.Length * 0x10));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EncryptCtrPartialBlock(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
Span<byte> counter = stackalloc byte[0x10];
|
||||||
|
Unsafe.WriteUnaligned(ref counter[0], _iv);
|
||||||
|
|
||||||
|
_aesCore.Encrypt(counter, counter);
|
||||||
|
|
||||||
|
input.CopyTo(output);
|
||||||
|
Util.XorArrays(output, counter);
|
||||||
|
|
||||||
|
for (int i = 0; i < counter.Length; i++)
|
||||||
|
{
|
||||||
|
if (++counter[i] != 0) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Unsafe.ReadUnaligned<Vector128<byte>>(ref counter[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
57
src/LibHac/Crypto2/AesEcbMode.cs
Normal file
57
src/LibHac/Crypto2/AesEcbMode.cs
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
using System;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
|
namespace LibHac.Crypto2
|
||||||
|
{
|
||||||
|
public class AesEcbEncryptor : ICipher
|
||||||
|
{
|
||||||
|
private ICryptoTransform _encryptor;
|
||||||
|
|
||||||
|
public AesEcbEncryptor(ReadOnlySpan<byte> key)
|
||||||
|
{
|
||||||
|
Aes aes = Aes.Create();
|
||||||
|
|
||||||
|
if (aes == null) throw new CryptographicException("Unable to create AES object");
|
||||||
|
aes.Key = key.ToArray();
|
||||||
|
aes.Mode = CipherMode.ECB;
|
||||||
|
aes.Padding = PaddingMode.None;
|
||||||
|
|
||||||
|
_encryptor = aes.CreateEncryptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
var outputBuffer = new byte[input.Length];
|
||||||
|
|
||||||
|
_encryptor.TransformBlock(input.ToArray(), 0, input.Length, outputBuffer, 0);
|
||||||
|
|
||||||
|
outputBuffer.CopyTo(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AesEcbDecryptor : ICipher
|
||||||
|
{
|
||||||
|
private ICryptoTransform _decryptor;
|
||||||
|
|
||||||
|
public AesEcbDecryptor(ReadOnlySpan<byte> key)
|
||||||
|
{
|
||||||
|
Aes aes = Aes.Create();
|
||||||
|
|
||||||
|
if (aes == null) throw new CryptographicException("Unable to create AES object");
|
||||||
|
aes.Key = key.ToArray();
|
||||||
|
aes.Mode = CipherMode.ECB;
|
||||||
|
aes.Padding = PaddingMode.None;
|
||||||
|
|
||||||
|
_decryptor = aes.CreateDecryptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
var outputBuffer = new byte[input.Length];
|
||||||
|
|
||||||
|
_decryptor.TransformBlock(input.ToArray(), 0, input.Length, outputBuffer, 0);
|
||||||
|
|
||||||
|
outputBuffer.CopyTo(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
64
src/LibHac/Crypto2/AesEcbModeHw.cs
Normal file
64
src/LibHac/Crypto2/AesEcbModeHw.cs
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
|
||||||
|
|
||||||
|
#if HAS_INTRINSICS
|
||||||
|
using System;
|
||||||
|
using System.Runtime.Intrinsics;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Runtime.Intrinsics.X86;
|
||||||
|
|
||||||
|
namespace LibHac.Crypto2
|
||||||
|
{
|
||||||
|
public class AesEcbEncryptorHw : ICipher
|
||||||
|
{
|
||||||
|
private AesCoreNi _aesCore;
|
||||||
|
|
||||||
|
public AesEcbEncryptorHw(ReadOnlySpan<byte> key)
|
||||||
|
{
|
||||||
|
_aesCore = new AesCoreNi();
|
||||||
|
_aesCore.Initialize(key, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
ReadOnlySpan<Vector128<byte>> keys = _aesCore.RoundKeys;
|
||||||
|
ReadOnlySpan<Vector128<byte>> inBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(input);
|
||||||
|
Span<Vector128<byte>> outBlocks = MemoryMarshal.Cast<byte, Vector128<byte>>(output);
|
||||||
|
|
||||||
|
for (int i = 0; i < inBlocks.Length; i++)
|
||||||
|
{
|
||||||
|
Vector128<byte> b = inBlocks[i];
|
||||||
|
|
||||||
|
b = Sse2.Xor(b, keys[0]);
|
||||||
|
b = Aes.Encrypt(b, keys[1]);
|
||||||
|
b = Aes.Encrypt(b, keys[2]);
|
||||||
|
b = Aes.Encrypt(b, keys[3]);
|
||||||
|
b = Aes.Encrypt(b, keys[4]);
|
||||||
|
b = Aes.Encrypt(b, keys[5]);
|
||||||
|
b = Aes.Encrypt(b, keys[6]);
|
||||||
|
b = Aes.Encrypt(b, keys[7]);
|
||||||
|
b = Aes.Encrypt(b, keys[8]);
|
||||||
|
b = Aes.Encrypt(b, keys[9]);
|
||||||
|
b = Aes.EncryptLast(b, keys[10]);
|
||||||
|
|
||||||
|
outBlocks[i] = b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AesEcbDecryptorHw : ICipher
|
||||||
|
{
|
||||||
|
private AesCoreNi _aesCore;
|
||||||
|
|
||||||
|
public AesEcbDecryptorHw(ReadOnlySpan<byte> key)
|
||||||
|
{
|
||||||
|
_aesCore = new AesCoreNi();
|
||||||
|
_aesCore.Initialize(key, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
|
||||||
|
{
|
||||||
|
_aesCore.Decrypt(input, output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
9
src/LibHac/Crypto2/ICipher.cs
Normal file
9
src/LibHac/Crypto2/ICipher.cs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace LibHac.Crypto2
|
||||||
|
{
|
||||||
|
public interface ICipher
|
||||||
|
{
|
||||||
|
void Transform(ReadOnlySpan<byte> input, Span<byte> output);
|
||||||
|
}
|
||||||
|
}
|
|
@ -31,7 +31,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
|
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
|
||||||
<DefineConstants>$(DefineConstants);STREAM_SPAN;STRING_SPAN;HAS_FILE_SYSTEM_NAME;CROSS_PLATFORM</DefineConstants>
|
<DefineConstants>$(DefineConstants);STREAM_SPAN;STRING_SPAN;HAS_FILE_SYSTEM_NAME;CROSS_PLATFORM;HAS_INTRINSICS</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
|
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
using System.Diagnostics;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
using LibHac;
|
using LibHac;
|
||||||
|
using LibHac.Crypto2;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
|
|
||||||
|
@ -32,55 +35,202 @@ namespace hactoolnet
|
||||||
logger.LogMessage($"{label}{rate}/s");
|
logger.LogMessage($"{label}{rate}/s");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void CipherBenchmark(ReadOnlySpan<byte> src, Span<byte> dst, Func<ICipher> cipherGenerator,
|
||||||
|
int iterations, string label, IProgressReport logger)
|
||||||
|
{
|
||||||
|
cipherGenerator().Transform(src, dst);
|
||||||
|
|
||||||
|
var watch = new Stopwatch();
|
||||||
|
var runTimes = new double[iterations];
|
||||||
|
|
||||||
|
logger.SetTotal(iterations);
|
||||||
|
|
||||||
|
for (int i = 0; i < iterations; i++)
|
||||||
|
{
|
||||||
|
ICipher cipher = cipherGenerator();
|
||||||
|
|
||||||
|
watch.Restart();
|
||||||
|
cipher.Transform(src, dst);
|
||||||
|
watch.Stop();
|
||||||
|
|
||||||
|
logger.ReportAdd(1);
|
||||||
|
runTimes[i] = watch.Elapsed.TotalSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.SetTotal(0);
|
||||||
|
|
||||||
|
long srcSize = src.Length;
|
||||||
|
|
||||||
|
double fastestRun = runTimes.Min();
|
||||||
|
double averageRun = runTimes.Average();
|
||||||
|
double slowestRun = runTimes.Max();
|
||||||
|
|
||||||
|
string fastestRate = Util.GetBytesReadable((long)(srcSize / fastestRun));
|
||||||
|
string averageRate = Util.GetBytesReadable((long)(srcSize / averageRun));
|
||||||
|
string slowestRate = Util.GetBytesReadable((long)(srcSize / slowestRun));
|
||||||
|
|
||||||
|
logger.LogMessage($"{label}{averageRate}/s, fastest run: {fastestRate}/s, slowest run: {slowestRate}/s");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CipherBenchmarkBlocked(ReadOnlySpan<byte> src, Span<byte> dst, Func<ICipher> cipherGenerator,
|
||||||
|
int iterations, string label, IProgressReport logger)
|
||||||
|
{
|
||||||
|
cipherGenerator().Transform(src, dst);
|
||||||
|
|
||||||
|
var watch = new Stopwatch();
|
||||||
|
var runTimes = new double[iterations];
|
||||||
|
|
||||||
|
logger.SetTotal(iterations);
|
||||||
|
|
||||||
|
int blockCount = src.Length / 0x10;
|
||||||
|
|
||||||
|
for (int i = 0; i < iterations; i++)
|
||||||
|
{
|
||||||
|
ICipher cipher = cipherGenerator();
|
||||||
|
|
||||||
|
watch.Restart();
|
||||||
|
|
||||||
|
for (int b = 0; b < blockCount; b++)
|
||||||
|
{
|
||||||
|
cipher.Transform(src.Slice(b * 0x10, 0x10), dst.Slice(b * 0x10, 0x10));
|
||||||
|
}
|
||||||
|
|
||||||
|
watch.Stop();
|
||||||
|
|
||||||
|
logger.ReportAdd(1);
|
||||||
|
runTimes[i] = watch.Elapsed.TotalSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.SetTotal(0);
|
||||||
|
|
||||||
|
long srcSize = src.Length;
|
||||||
|
|
||||||
|
double fastestRun = runTimes.Min();
|
||||||
|
double averageRun = runTimes.Average();
|
||||||
|
double slowestRun = runTimes.Max();
|
||||||
|
|
||||||
|
string fastestRate = Util.GetBytesReadable((long)(srcSize / fastestRun));
|
||||||
|
string averageRate = Util.GetBytesReadable((long)(srcSize / averageRun));
|
||||||
|
string slowestRate = Util.GetBytesReadable((long)(srcSize / slowestRun));
|
||||||
|
|
||||||
|
logger.LogMessage($"{label}{averageRate}/s, fastest run: {fastestRate}/s, slowest run: {slowestRate}/s");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void RunCipherBenchmark(Func<ICipher> cipherNet, Func<ICipher> cipherLibHac, string label, IProgressReport logger)
|
||||||
|
{
|
||||||
|
var srcData = new byte[Size];
|
||||||
|
|
||||||
|
var dstDataLh = new byte[Size];
|
||||||
|
var dstDataNet = new byte[Size];
|
||||||
|
var dstDataBlockedLh = new byte[Size];
|
||||||
|
var dstDataBlockedNet = new byte[Size];
|
||||||
|
|
||||||
|
logger.LogMessage(string.Empty);
|
||||||
|
logger.LogMessage(label);
|
||||||
|
|
||||||
|
if (AesCrypto.IsAesNiSupported()) CipherBenchmark(srcData, dstDataLh, cipherLibHac, Iterations, "LibHac impl: ", logger);
|
||||||
|
CipherBenchmark(srcData, dstDataNet, cipherNet, Iterations, ".NET impl: ", logger);
|
||||||
|
|
||||||
|
if (AesCrypto.IsAesNiSupported()) CipherBenchmarkBlocked(srcData, dstDataBlockedLh, cipherLibHac, Iterations / 5, "LibHac impl (blocked): ", logger);
|
||||||
|
CipherBenchmarkBlocked(srcData, dstDataBlockedNet, cipherNet, Iterations / 5, ".NET impl (blocked): ", logger);
|
||||||
|
|
||||||
|
if (AesCrypto.IsAesNiSupported())
|
||||||
|
{
|
||||||
|
logger.LogMessage($"{dstDataLh.SequenceEqual(dstDataNet)}");
|
||||||
|
logger.LogMessage($"{dstDataLh.SequenceEqual(dstDataBlockedLh)}");
|
||||||
|
logger.LogMessage($"{dstDataLh.SequenceEqual(dstDataBlockedNet)}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void Process(Context ctx)
|
public static void Process(Context ctx)
|
||||||
{
|
{
|
||||||
switch (ctx.Options.BenchType?.ToLower())
|
switch (ctx.Options.BenchType?.ToLower())
|
||||||
{
|
{
|
||||||
case "aesctr":
|
case "aesctr":
|
||||||
{
|
{
|
||||||
|
|
||||||
IStorage decStorage = new MemoryStorage(new byte[Size]);
|
IStorage decStorage = new MemoryStorage(new byte[Size]);
|
||||||
IStorage encStorage = new Aes128CtrStorage(new MemoryStorage(new byte[Size]), new byte[0x10], new byte[0x10], true);
|
IStorage encStorage = new Aes128CtrStorage(new MemoryStorage(new byte[Size]), new byte[0x10], new byte[0x10], true);
|
||||||
|
|
||||||
CopyBenchmark(decStorage, encStorage, Iterations, "MemoryStorage Encrypt: ", ctx.Logger);
|
CopyBenchmark(decStorage, encStorage, Iterations, "MemoryStorage Encrypt: ", ctx.Logger);
|
||||||
CopyBenchmark(encStorage, decStorage, Iterations, "MemoryStorage Decrypt: ", ctx.Logger);
|
CopyBenchmark(encStorage, decStorage, Iterations, "MemoryStorage Decrypt: ", ctx.Logger);
|
||||||
|
|
||||||
decStorage = new NullStorage(Size);
|
decStorage = new NullStorage(Size);
|
||||||
encStorage = new Aes128CtrStorage(new NullStorage(Size), new byte[0x10], new byte[0x10], true);
|
encStorage = new Aes128CtrStorage(new NullStorage(Size), new byte[0x10], new byte[0x10], true);
|
||||||
|
|
||||||
CopyBenchmark(decStorage, encStorage, Iterations, "NullStorage Encrypt: ", ctx.Logger);
|
CopyBenchmark(decStorage, encStorage, Iterations, "NullStorage Encrypt: ", ctx.Logger);
|
||||||
CopyBenchmark(encStorage, decStorage, Iterations, "NullStorage Decrypt: ", ctx.Logger);
|
CopyBenchmark(encStorage, decStorage, Iterations, "NullStorage Decrypt: ", ctx.Logger);
|
||||||
|
|
||||||
decStorage = new MemoryStorage(new byte[Size]);
|
decStorage = new MemoryStorage(new byte[Size]);
|
||||||
encStorage = new CachedStorage(new Aes128CtrStorage(new MemoryStorage(new byte[Size]), new byte[0x10], new byte[0x10], true), 0x4000, 4, true);
|
encStorage = new CachedStorage(new Aes128CtrStorage(new MemoryStorage(new byte[Size]), new byte[0x10], new byte[0x10], true), 0x4000, 4, true);
|
||||||
|
|
||||||
CopyBenchmark(decStorage, encStorage, Iterations, "CachedStorage Encrypt: ", ctx.Logger);
|
CopyBenchmark(decStorage, encStorage, Iterations, "CachedStorage Encrypt: ", ctx.Logger);
|
||||||
CopyBenchmark(encStorage, decStorage, Iterations, "CachedStorage Decrypt: ", ctx.Logger);
|
CopyBenchmark(encStorage, decStorage, Iterations, "CachedStorage Decrypt: ", ctx.Logger);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case "aesxts":
|
case "aesxts":
|
||||||
{
|
{
|
||||||
IStorage decStorage = new MemoryStorage(new byte[Size]);
|
IStorage decStorage = new MemoryStorage(new byte[Size]);
|
||||||
IStorage encStorage = new Aes128XtsStorage(new MemoryStorage(new byte[Size]), new byte[0x20], 81920, true);
|
IStorage encStorage = new Aes128XtsStorage(new MemoryStorage(new byte[Size]), new byte[0x20], 81920, true);
|
||||||
|
|
||||||
CopyBenchmark(decStorage, encStorage, Iterations, "MemoryStorage Encrypt: ", ctx.Logger);
|
CopyBenchmark(decStorage, encStorage, Iterations, "MemoryStorage Encrypt: ", ctx.Logger);
|
||||||
CopyBenchmark(encStorage, decStorage, Iterations, "MemoryStorage Decrypt: ", ctx.Logger);
|
CopyBenchmark(encStorage, decStorage, Iterations, "MemoryStorage Decrypt: ", ctx.Logger);
|
||||||
|
|
||||||
decStorage = new NullStorage(Size);
|
decStorage = new NullStorage(Size);
|
||||||
encStorage = new Aes128XtsStorage(new NullStorage(Size), new byte[0x20], 81920, true);
|
encStorage = new Aes128XtsStorage(new NullStorage(Size), new byte[0x20], 81920, true);
|
||||||
|
|
||||||
CopyBenchmark(decStorage, encStorage, Iterations, "NullStorage Encrypt: ", ctx.Logger);
|
CopyBenchmark(decStorage, encStorage, Iterations, "NullStorage Encrypt: ", ctx.Logger);
|
||||||
CopyBenchmark(encStorage, decStorage, Iterations, "NullStorage Decrypt: ", ctx.Logger);
|
CopyBenchmark(encStorage, decStorage, Iterations, "NullStorage Decrypt: ", ctx.Logger);
|
||||||
|
|
||||||
decStorage = new MemoryStorage(new byte[Size]);
|
decStorage = new MemoryStorage(new byte[Size]);
|
||||||
encStorage = new CachedStorage(new Aes128XtsStorage(new MemoryStorage(new byte[Size]), new byte[0x20], 0x4000, true), 4, true);
|
encStorage = new CachedStorage(new Aes128XtsStorage(new MemoryStorage(new byte[Size]), new byte[0x20], 0x4000, true), 4, true);
|
||||||
|
|
||||||
|
CopyBenchmark(decStorage, encStorage, Iterations, "CachedStorage Encrypt: ", ctx.Logger);
|
||||||
|
CopyBenchmark(encStorage, decStorage, Iterations, "CachedStorage Decrypt: ", ctx.Logger);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "aesecbnew":
|
||||||
|
{
|
||||||
|
Func<ICipher> encryptorNet = () => AesCrypto.CreateEcbEncryptor(new byte[0x10], true);
|
||||||
|
Func<ICipher> encryptorLh = () => AesCrypto.CreateEcbEncryptor(new byte[0x10]);
|
||||||
|
|
||||||
|
RunCipherBenchmark(encryptorNet, encryptorLh, "AES-ECB encrypt", ctx.Logger);
|
||||||
|
|
||||||
|
Func<ICipher> decryptorNet = () => AesCrypto.CreateEcbDecryptor(new byte[0x10], true);
|
||||||
|
Func<ICipher> decryptorLh = () => AesCrypto.CreateEcbDecryptor(new byte[0x10]);
|
||||||
|
|
||||||
|
RunCipherBenchmark(decryptorNet, decryptorLh, "AES-ECB decrypt", ctx.Logger);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "aescbcnew":
|
||||||
|
{
|
||||||
|
Func<ICipher> encryptorNet = () => AesCrypto.CreateCbcEncryptor(new byte[0x10], new byte[0x10], true);
|
||||||
|
Func<ICipher> encryptorLh = () => AesCrypto.CreateCbcEncryptor(new byte[0x10], new byte[0x10]);
|
||||||
|
|
||||||
|
RunCipherBenchmark(encryptorNet, encryptorLh, "AES-CBC encrypt", ctx.Logger);
|
||||||
|
|
||||||
|
Func<ICipher> decryptorNet = () => AesCrypto.CreateCbcDecryptor(new byte[0x10], new byte[0x10], true);
|
||||||
|
Func<ICipher> decryptorLh = () => AesCrypto.CreateCbcDecryptor(new byte[0x10], new byte[0x10]);
|
||||||
|
|
||||||
|
RunCipherBenchmark(decryptorNet, decryptorLh, "AES-CBC decrypt", ctx.Logger);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "aesctrnew":
|
||||||
|
{
|
||||||
|
Func<ICipher> encryptorNet = () => AesCrypto.CreateCtrEncryptor(new byte[0x10], new byte[0x10], true);
|
||||||
|
Func<ICipher> encryptorLh = () => AesCrypto.CreateCtrEncryptor(new byte[0x10], new byte[0x10]);
|
||||||
|
|
||||||
|
RunCipherBenchmark(encryptorNet, encryptorLh, "AES-CTR", ctx.Logger);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
CopyBenchmark(decStorage, encStorage, Iterations, "CachedStorage Encrypt: ", ctx.Logger);
|
|
||||||
CopyBenchmark(encStorage, decStorage, Iterations, "CachedStorage Decrypt: ", ctx.Logger);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
ctx.Logger.LogMessage("Unknown benchmark type.");
|
ctx.Logger.LogMessage("Unknown benchmark type.");
|
||||||
return;
|
return;
|
||||||
|
|
76
tests/LibHac.Tests/CryptoTests/AesCbcTests.cs
Normal file
76
tests/LibHac.Tests/CryptoTests/AesCbcTests.cs
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
using LibHac.Crypto2;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace LibHac.Tests.CryptoTests
|
||||||
|
{
|
||||||
|
public class AesCbcTests
|
||||||
|
{
|
||||||
|
public static TheoryData<EncryptionTestVector> EncryptTestVectors =
|
||||||
|
RspReader.ReadTestVectors(true, "CBCVarKey128.rsp", "CBCVarTxt128.rsp", "CBCKeySbox128.rsp", "CBCGFSbox128.rsp");
|
||||||
|
|
||||||
|
public static TheoryData<EncryptionTestVector> DecryptTestVectors =
|
||||||
|
RspReader.ReadTestVectors(false, "CBCVarKey128.rsp", "CBCVarTxt128.rsp", "CBCKeySbox128.rsp", "CBCGFSbox128.rsp");
|
||||||
|
|
||||||
|
public static TheoryData<EncryptionTestVector> EncryptMultiTestVectors =
|
||||||
|
RspReader.ReadTestVectors(true, "CBCMMT128.rsp");
|
||||||
|
|
||||||
|
public static TheoryData<EncryptionTestVector> DecryptMultiTestVectors =
|
||||||
|
RspReader.ReadTestVectors(false, "CBCMMT128.rsp");
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData(nameof(EncryptTestVectors))]
|
||||||
|
public static void Encrypt(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.PlainText, tv.CipherText, AesCrypto.CreateCbcEncryptor(tv.Key, tv.Iv, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData(nameof(DecryptTestVectors))]
|
||||||
|
public static void Decrypt(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.CipherText, tv.PlainText, AesCrypto.CreateCbcDecryptor(tv.Key, tv.Iv, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData(nameof(EncryptMultiTestVectors))]
|
||||||
|
public static void EncryptMulti(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.PlainText, tv.CipherText, AesCrypto.CreateCbcEncryptor(tv.Key, tv.Iv, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData(nameof(DecryptMultiTestVectors))]
|
||||||
|
public static void DecryptMulti(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.CipherText, tv.PlainText, AesCrypto.CreateCbcDecryptor(tv.Key, tv.Iv, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
[AesIntrinsicsRequiredTheory]
|
||||||
|
[MemberData(nameof(EncryptTestVectors))]
|
||||||
|
public static void EncryptIntrinsics(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.PlainText, tv.CipherText, AesCrypto.CreateCbcEncryptor(tv.Key, tv.Iv));
|
||||||
|
}
|
||||||
|
|
||||||
|
[AesIntrinsicsRequiredTheory]
|
||||||
|
[MemberData(nameof(DecryptTestVectors))]
|
||||||
|
public static void DecryptIntrinsics(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.CipherText, tv.PlainText, AesCrypto.CreateCbcDecryptor(tv.Key, tv.Iv));
|
||||||
|
}
|
||||||
|
|
||||||
|
[AesIntrinsicsRequiredTheory]
|
||||||
|
[MemberData(nameof(EncryptMultiTestVectors))]
|
||||||
|
public static void EncryptMultiIntrinsics(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.PlainText, tv.CipherText, AesCrypto.CreateCbcEncryptor(tv.Key, tv.Iv));
|
||||||
|
}
|
||||||
|
|
||||||
|
[AesIntrinsicsRequiredTheory]
|
||||||
|
[MemberData(nameof(DecryptMultiTestVectors))]
|
||||||
|
public static void DecryptMultiIntrinsics(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.CipherText, tv.PlainText, AesCrypto.CreateCbcDecryptor(tv.Key, tv.Iv));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
24
tests/LibHac.Tests/CryptoTests/AesCtrTests.cs
Normal file
24
tests/LibHac.Tests/CryptoTests/AesCtrTests.cs
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
76
tests/LibHac.Tests/CryptoTests/AesEcbTests.cs
Normal file
76
tests/LibHac.Tests/CryptoTests/AesEcbTests.cs
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
using LibHac.Crypto2;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace LibHac.Tests.CryptoTests
|
||||||
|
{
|
||||||
|
public class AesEcbTests
|
||||||
|
{
|
||||||
|
public static TheoryData<EncryptionTestVector> EncryptTestVectors =
|
||||||
|
RspReader.ReadTestVectors(true, "ECBVarKey128.rsp", "ECBVarTxt128.rsp", "ECBKeySbox128.rsp", "ECBGFSbox128.rsp");
|
||||||
|
|
||||||
|
public static TheoryData<EncryptionTestVector> DecryptTestVectors =
|
||||||
|
RspReader.ReadTestVectors(false, "ECBVarKey128.rsp", "ECBVarTxt128.rsp", "ECBKeySbox128.rsp", "ECBGFSbox128.rsp");
|
||||||
|
|
||||||
|
public static TheoryData<EncryptionTestVector> EncryptMultiTestVectors =
|
||||||
|
RspReader.ReadTestVectors(true, "ECBMMT128.rsp");
|
||||||
|
|
||||||
|
public static TheoryData<EncryptionTestVector> DecryptMultiTestVectors =
|
||||||
|
RspReader.ReadTestVectors(false, "ECBMMT128.rsp");
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData(nameof(EncryptTestVectors))]
|
||||||
|
public static void Encrypt(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.PlainText, tv.CipherText, AesCrypto.CreateEcbEncryptor(tv.Key, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData(nameof(DecryptTestVectors))]
|
||||||
|
public static void Decrypt(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.CipherText, tv.PlainText, AesCrypto.CreateEcbDecryptor(tv.Key, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData(nameof(EncryptMultiTestVectors))]
|
||||||
|
public static void EncryptMulti(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.PlainText, tv.CipherText, AesCrypto.CreateEcbEncryptor(tv.Key, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData(nameof(DecryptMultiTestVectors))]
|
||||||
|
public static void DecryptMulti(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.CipherText, tv.PlainText, AesCrypto.CreateEcbDecryptor(tv.Key, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
[AesIntrinsicsRequiredTheory]
|
||||||
|
[MemberData(nameof(EncryptTestVectors))]
|
||||||
|
public static void EncryptIntrinsics(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.PlainText, tv.CipherText, AesCrypto.CreateEcbEncryptor(tv.Key));
|
||||||
|
}
|
||||||
|
|
||||||
|
[AesIntrinsicsRequiredTheory]
|
||||||
|
[MemberData(nameof(DecryptTestVectors))]
|
||||||
|
public static void DecryptIntrinsics(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.CipherText, tv.PlainText, AesCrypto.CreateEcbDecryptor(tv.Key));
|
||||||
|
}
|
||||||
|
|
||||||
|
[AesIntrinsicsRequiredTheory]
|
||||||
|
[MemberData(nameof(EncryptMultiTestVectors))]
|
||||||
|
public static void EncryptMultiIntrinsics(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.PlainText, tv.CipherText, AesCrypto.CreateEcbEncryptor(tv.Key));
|
||||||
|
}
|
||||||
|
|
||||||
|
[AesIntrinsicsRequiredTheory]
|
||||||
|
[MemberData(nameof(DecryptMultiTestVectors))]
|
||||||
|
public static void DecryptMultiIntrinsics(EncryptionTestVector tv)
|
||||||
|
{
|
||||||
|
Common.CipherTestCore(tv.CipherText, tv.PlainText, AesCrypto.CreateEcbDecryptor(tv.Key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
using LibHac.Crypto2;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace LibHac.Tests.CryptoTests
|
||||||
|
{
|
||||||
|
public sealed class AesIntrinsicsRequiredTheoryAttribute : TheoryAttribute
|
||||||
|
{
|
||||||
|
public AesIntrinsicsRequiredTheoryAttribute()
|
||||||
|
{
|
||||||
|
if (!AesCrypto.IsAesNiSupported())
|
||||||
|
{
|
||||||
|
Skip = "AES intrinsics required";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
17
tests/LibHac.Tests/CryptoTests/Common.cs
Normal file
17
tests/LibHac.Tests/CryptoTests/Common.cs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
using LibHac.Crypto2;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace LibHac.Tests.CryptoTests
|
||||||
|
{
|
||||||
|
internal static class Common
|
||||||
|
{
|
||||||
|
internal static void CipherTestCore(byte[] inputData, byte[] expected, ICipher cipher)
|
||||||
|
{
|
||||||
|
var outputData = new byte[expected.Length];
|
||||||
|
|
||||||
|
cipher.Transform(inputData, outputData);
|
||||||
|
|
||||||
|
Assert.Equal(expected, outputData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
111
tests/LibHac.Tests/CryptoTests/RspReader.cs
Normal file
111
tests/LibHac.Tests/CryptoTests/RspReader.cs
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace LibHac.Tests.CryptoTests
|
||||||
|
{
|
||||||
|
public class RspReader
|
||||||
|
{
|
||||||
|
private StreamReader Reader { get; }
|
||||||
|
|
||||||
|
public RspReader(Stream stream)
|
||||||
|
{
|
||||||
|
Reader = new StreamReader(stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<EncryptionTestVector> GetTestVectors()
|
||||||
|
{
|
||||||
|
string line;
|
||||||
|
bool isEncryptType = false;
|
||||||
|
|
||||||
|
var testVector = new EncryptionTestVector();
|
||||||
|
bool canOutputVector = false;
|
||||||
|
|
||||||
|
while ((line = Reader.ReadLine()?.Trim()) != null)
|
||||||
|
{
|
||||||
|
if (line.Length == 0)
|
||||||
|
{
|
||||||
|
if (canOutputVector)
|
||||||
|
{
|
||||||
|
testVector.Encrypt = isEncryptType;
|
||||||
|
|
||||||
|
yield return testVector;
|
||||||
|
|
||||||
|
testVector = new EncryptionTestVector();
|
||||||
|
canOutputVector = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line[0] == '#') continue;
|
||||||
|
|
||||||
|
if (line[0] == '[')
|
||||||
|
{
|
||||||
|
if (line == "[ENCRYPT]") isEncryptType = true;
|
||||||
|
if (line == "[DECRYPT]") isEncryptType = false;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
string[] kvp = line.Split(new[] { " = " }, StringSplitOptions.None);
|
||||||
|
if (kvp.Length != 2) throw new InvalidDataException();
|
||||||
|
|
||||||
|
canOutputVector = true;
|
||||||
|
|
||||||
|
switch (kvp[0])
|
||||||
|
{
|
||||||
|
case "COUNT":
|
||||||
|
testVector.Count = int.Parse(kvp[1]);
|
||||||
|
break;
|
||||||
|
case "KEY":
|
||||||
|
testVector.Key = kvp[1].ToBytes();
|
||||||
|
break;
|
||||||
|
case "IV":
|
||||||
|
testVector.Iv = kvp[1].ToBytes();
|
||||||
|
break;
|
||||||
|
case "PLAINTEXT":
|
||||||
|
testVector.PlainText = kvp[1].ToBytes();
|
||||||
|
break;
|
||||||
|
case "CIPHERTEXT":
|
||||||
|
testVector.CipherText = kvp[1].ToBytes();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TheoryData<EncryptionTestVector> ReadTestVectors(bool getEncryptTests, params string[] filenames)
|
||||||
|
{
|
||||||
|
IEnumerable<string> resourcePaths = filenames.Select(x => $"LibHac.Tests.CryptoTests.TestVectors.{x}");
|
||||||
|
var testVectors = new TheoryData<EncryptionTestVector>();
|
||||||
|
|
||||||
|
foreach (string path in resourcePaths)
|
||||||
|
{
|
||||||
|
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(path))
|
||||||
|
{
|
||||||
|
var reader = new RspReader(stream);
|
||||||
|
|
||||||
|
foreach (EncryptionTestVector tv in reader.GetTestVectors().Where(x => x.Encrypt == getEncryptTests))
|
||||||
|
{
|
||||||
|
testVectors.Add(tv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return testVectors;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EncryptionTestVector
|
||||||
|
{
|
||||||
|
public bool Encrypt { get; set; }
|
||||||
|
public int Count { get; set; }
|
||||||
|
public byte[] Key { get; set; }
|
||||||
|
public byte[] Iv { get; set; }
|
||||||
|
public byte[] PlainText { get; set; }
|
||||||
|
public byte[] CipherText { get; set; }
|
||||||
|
}
|
||||||
|
}
|
95
tests/LibHac.Tests/CryptoTests/TestVectors/CBCGFSbox128.rsp
Normal file
95
tests/LibHac.Tests/CryptoTests/TestVectors/CBCGFSbox128.rsp
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
# CAVS 11.1
|
||||||
|
# Config info for aes_values
|
||||||
|
# AESVS GFSbox test data for CBC
|
||||||
|
# State : Encrypt and Decrypt
|
||||||
|
# Key Length : 128
|
||||||
|
# Generated on Fri Apr 22 15:11:33 2011
|
||||||
|
|
||||||
|
[ENCRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = f34481ec3cc627bacd5dc3fb08f273e6
|
||||||
|
CIPHERTEXT = 0336763e966d92595a567cc9ce537f5e
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 9798c4640bad75c7c3227db910174e72
|
||||||
|
CIPHERTEXT = a9a1631bf4996954ebc093957b234589
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 96ab5c2ff612d9dfaae8c31f30c42168
|
||||||
|
CIPHERTEXT = ff4f8391a6a40ca5b25d23bedd44a597
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 6a118a874519e64e9963798a503f1d35
|
||||||
|
CIPHERTEXT = dc43be40be0e53712f7e2bf5ca707209
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = cb9fceec81286ca3e989bd979b0cb284
|
||||||
|
CIPHERTEXT = 92beedab1895a94faa69b632e5cc47ce
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = b26aeb1874e47ca8358ff22378f09144
|
||||||
|
CIPHERTEXT = 459264f4798f6a78bacb89c15ed3d601
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 58c8e00b2631686d54eab84b91f0aca1
|
||||||
|
CIPHERTEXT = 08a4e2efec8a8e3312ca7460b9040bbf
|
||||||
|
|
||||||
|
[DECRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 0336763e966d92595a567cc9ce537f5e
|
||||||
|
PLAINTEXT = f34481ec3cc627bacd5dc3fb08f273e6
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = a9a1631bf4996954ebc093957b234589
|
||||||
|
PLAINTEXT = 9798c4640bad75c7c3227db910174e72
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = ff4f8391a6a40ca5b25d23bedd44a597
|
||||||
|
PLAINTEXT = 96ab5c2ff612d9dfaae8c31f30c42168
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = dc43be40be0e53712f7e2bf5ca707209
|
||||||
|
PLAINTEXT = 6a118a874519e64e9963798a503f1d35
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 92beedab1895a94faa69b632e5cc47ce
|
||||||
|
PLAINTEXT = cb9fceec81286ca3e989bd979b0cb284
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 459264f4798f6a78bacb89c15ed3d601
|
||||||
|
PLAINTEXT = b26aeb1874e47ca8358ff22378f09144
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 08a4e2efec8a8e3312ca7460b9040bbf
|
||||||
|
PLAINTEXT = 58c8e00b2631686d54eab84b91f0aca1
|
||||||
|
|
263
tests/LibHac.Tests/CryptoTests/TestVectors/CBCKeySbox128.rsp
Normal file
263
tests/LibHac.Tests/CryptoTests/TestVectors/CBCKeySbox128.rsp
Normal file
|
@ -0,0 +1,263 @@
|
||||||
|
# CAVS 11.1
|
||||||
|
# Config info for aes_values
|
||||||
|
# AESVS KeySbox test data for CBC
|
||||||
|
# State : Encrypt and Decrypt
|
||||||
|
# Key Length : 128
|
||||||
|
# Generated on Fri Apr 22 15:11:33 2011
|
||||||
|
|
||||||
|
[ENCRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 10a58869d74be5a374cf867cfb473859
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 6d251e6944b051e04eaa6fb4dbf78465
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = caea65cdbb75e9169ecd22ebe6e54675
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 6e29201190152df4ee058139def610bb
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = a2e2fa9baf7d20822ca9f0542f764a41
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = c3b44b95d9d2f25670eee9a0de099fa3
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = b6364ac4e1de1e285eaf144a2415f7a0
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 5d9b05578fc944b3cf1ccf0e746cd581
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = 64cf9c7abc50b888af65f49d521944b2
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = f7efc89d5dba578104016ce5ad659c05
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = 47d6742eefcc0465dc96355e851b64d9
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 0306194f666d183624aa230a8b264ae7
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 3eb39790678c56bee34bbcdeccf6cdb5
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 858075d536d79ccee571f7d7204b1f67
|
||||||
|
|
||||||
|
COUNT = 7
|
||||||
|
KEY = 64110a924f0743d500ccadae72c13427
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 35870c6a57e9e92314bcb8087cde72ce
|
||||||
|
|
||||||
|
COUNT = 8
|
||||||
|
KEY = 18d8126516f8a12ab1a36d9f04d68e51
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 6c68e9be5ec41e22c825b7c7affb4363
|
||||||
|
|
||||||
|
COUNT = 9
|
||||||
|
KEY = f530357968578480b398a3c251cd1093
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = f5df39990fc688f1b07224cc03e86cea
|
||||||
|
|
||||||
|
COUNT = 10
|
||||||
|
KEY = da84367f325d42d601b4326964802e8e
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = bba071bcb470f8f6586e5d3add18bc66
|
||||||
|
|
||||||
|
COUNT = 11
|
||||||
|
KEY = e37b1c6aa2846f6fdb413f238b089f23
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 43c9f7e62f5d288bb27aa40ef8fe1ea8
|
||||||
|
|
||||||
|
COUNT = 12
|
||||||
|
KEY = 6c002b682483e0cabcc731c253be5674
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 3580d19cff44f1014a7c966a69059de5
|
||||||
|
|
||||||
|
COUNT = 13
|
||||||
|
KEY = 143ae8ed6555aba96110ab58893a8ae1
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 806da864dd29d48deafbe764f8202aef
|
||||||
|
|
||||||
|
COUNT = 14
|
||||||
|
KEY = b69418a85332240dc82492353956ae0c
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = a303d940ded8f0baff6f75414cac5243
|
||||||
|
|
||||||
|
COUNT = 15
|
||||||
|
KEY = 71b5c08a1993e1362e4d0ce9b22b78d5
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = c2dabd117f8a3ecabfbb11d12194d9d0
|
||||||
|
|
||||||
|
COUNT = 16
|
||||||
|
KEY = e234cdca2606b81f29408d5f6da21206
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = fff60a4740086b3b9c56195b98d91a7b
|
||||||
|
|
||||||
|
COUNT = 17
|
||||||
|
KEY = 13237c49074a3da078dc1d828bb78c6f
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 8146a08e2357f0caa30ca8c94d1a0544
|
||||||
|
|
||||||
|
COUNT = 18
|
||||||
|
KEY = 3071a2a48fe6cbd04f1a129098e308f8
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 4b98e06d356deb07ebb824e5713f7be3
|
||||||
|
|
||||||
|
COUNT = 19
|
||||||
|
KEY = 90f42ec0f68385f2ffc5dfc03a654dce
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 7a20a53d460fc9ce0423a7a0764c6cf2
|
||||||
|
|
||||||
|
COUNT = 20
|
||||||
|
KEY = febd9a24d8b65c1c787d50a4ed3619a9
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = f4a70d8af877f9b02b4c40df57d45b17
|
||||||
|
|
||||||
|
[DECRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 10a58869d74be5a374cf867cfb473859
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 6d251e6944b051e04eaa6fb4dbf78465
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = caea65cdbb75e9169ecd22ebe6e54675
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 6e29201190152df4ee058139def610bb
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = a2e2fa9baf7d20822ca9f0542f764a41
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = c3b44b95d9d2f25670eee9a0de099fa3
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = b6364ac4e1de1e285eaf144a2415f7a0
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 5d9b05578fc944b3cf1ccf0e746cd581
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = 64cf9c7abc50b888af65f49d521944b2
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = f7efc89d5dba578104016ce5ad659c05
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = 47d6742eefcc0465dc96355e851b64d9
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 0306194f666d183624aa230a8b264ae7
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 3eb39790678c56bee34bbcdeccf6cdb5
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 858075d536d79ccee571f7d7204b1f67
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 7
|
||||||
|
KEY = 64110a924f0743d500ccadae72c13427
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 35870c6a57e9e92314bcb8087cde72ce
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 8
|
||||||
|
KEY = 18d8126516f8a12ab1a36d9f04d68e51
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 6c68e9be5ec41e22c825b7c7affb4363
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 9
|
||||||
|
KEY = f530357968578480b398a3c251cd1093
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = f5df39990fc688f1b07224cc03e86cea
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 10
|
||||||
|
KEY = da84367f325d42d601b4326964802e8e
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = bba071bcb470f8f6586e5d3add18bc66
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 11
|
||||||
|
KEY = e37b1c6aa2846f6fdb413f238b089f23
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 43c9f7e62f5d288bb27aa40ef8fe1ea8
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 12
|
||||||
|
KEY = 6c002b682483e0cabcc731c253be5674
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 3580d19cff44f1014a7c966a69059de5
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 13
|
||||||
|
KEY = 143ae8ed6555aba96110ab58893a8ae1
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 806da864dd29d48deafbe764f8202aef
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 14
|
||||||
|
KEY = b69418a85332240dc82492353956ae0c
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = a303d940ded8f0baff6f75414cac5243
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 15
|
||||||
|
KEY = 71b5c08a1993e1362e4d0ce9b22b78d5
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = c2dabd117f8a3ecabfbb11d12194d9d0
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 16
|
||||||
|
KEY = e234cdca2606b81f29408d5f6da21206
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = fff60a4740086b3b9c56195b98d91a7b
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 17
|
||||||
|
KEY = 13237c49074a3da078dc1d828bb78c6f
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 8146a08e2357f0caa30ca8c94d1a0544
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 18
|
||||||
|
KEY = 3071a2a48fe6cbd04f1a129098e308f8
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 4b98e06d356deb07ebb824e5713f7be3
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 19
|
||||||
|
KEY = 90f42ec0f68385f2ffc5dfc03a654dce
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 7a20a53d460fc9ce0423a7a0764c6cf2
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 20
|
||||||
|
KEY = febd9a24d8b65c1c787d50a4ed3619a9
|
||||||
|
IV = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = f4a70d8af877f9b02b4c40df57d45b17
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
131
tests/LibHac.Tests/CryptoTests/TestVectors/CBCMMT128.rsp
Normal file
131
tests/LibHac.Tests/CryptoTests/TestVectors/CBCMMT128.rsp
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
# CAVS 11.1
|
||||||
|
# Config info for aes_values
|
||||||
|
# AESVS MMT test data for CBC
|
||||||
|
# State : Encrypt and Decrypt
|
||||||
|
# Key Length : 128
|
||||||
|
# Generated on Fri Apr 22 15:11:33 2011
|
||||||
|
|
||||||
|
[ENCRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 1f8e4973953f3fb0bd6b16662e9a3c17
|
||||||
|
IV = 2fe2b333ceda8f98f4a99b40d2cd34a8
|
||||||
|
PLAINTEXT = 45cf12964fc824ab76616ae2f4bf0822
|
||||||
|
CIPHERTEXT = 0f61c4d44c5147c03c195ad7e2cc12b2
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = 0700d603a1c514e46b6191ba430a3a0c
|
||||||
|
IV = aad1583cd91365e3bb2f0c3430d065bb
|
||||||
|
PLAINTEXT = 068b25c7bfb1f8bdd4cfc908f69dffc5ddc726a197f0e5f720f730393279be91
|
||||||
|
CIPHERTEXT = c4dc61d9725967a3020104a9738f23868527ce839aab1752fd8bdb95a82c4d00
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = 3348aa51e9a45c2dbe33ccc47f96e8de
|
||||||
|
IV = 19153c673160df2b1d38c28060e59b96
|
||||||
|
PLAINTEXT = 9b7cee827a26575afdbb7c7a329f887238052e3601a7917456ba61251c214763d5e1847a6ad5d54127a399ab07ee3599
|
||||||
|
CIPHERTEXT = d5aed6c9622ec451a15db12819952b6752501cf05cdbf8cda34a457726ded97818e1f127a28d72db5652749f0c6afee5
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = b7f3c9576e12dd0db63e8f8fac2b9a39
|
||||||
|
IV = c80f095d8bb1a060699f7c19974a1aa0
|
||||||
|
PLAINTEXT = 9ac19954ce1319b354d3220460f71c1e373f1cd336240881160cfde46ebfed2e791e8d5a1a136ebd1dc469dec00c4187722b841cdabcb22c1be8a14657da200e
|
||||||
|
CIPHERTEXT = 19b9609772c63f338608bf6eb52ca10be65097f89c1e0905c42401fd47791ae2c5440b2d473116ca78bd9ff2fb6015cfd316524eae7dcb95ae738ebeae84a467
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = b6f9afbfe5a1562bba1368fc72ac9d9c
|
||||||
|
IV = 3f9d5ebe250ee7ce384b0d00ee849322
|
||||||
|
PLAINTEXT = db397ec22718dbffb9c9d13de0efcd4611bf792be4fce0dc5f25d4f577ed8cdbd4eb9208d593dda3d4653954ab64f05676caa3ce9bfa795b08b67ceebc923fdc89a8c431188e9e482d8553982cf304d1
|
||||||
|
CIPHERTEXT = 10ea27b19e16b93af169c4a88e06e35c99d8b420980b058e34b4b8f132b13766f72728202b089f428fecdb41c79f8aa0d0ef68f5786481cca29e2126f69bc14160f1ae2187878ba5c49cf3961e1b7ee9
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = bbe7b7ba07124ff1ae7c3416fe8b465e
|
||||||
|
IV = 7f65b5ee3630bed6b84202d97fb97a1e
|
||||||
|
PLAINTEXT = 2aad0c2c4306568bad7447460fd3dac054346d26feddbc9abd9110914011b4794be2a9a00a519a51a5b5124014f4ed2735480db21b434e99a911bb0b60fe0253763725b628d5739a5117b7ee3aefafc5b4c1bf446467e7bf5f78f31ff7caf187
|
||||||
|
CIPHERTEXT = 3b8611bfc4973c5cd8e982b073b33184cd26110159172e44988eb5ff5661a1e16fad67258fcbfee55469267a12dc374893b4e3533d36f5634c3095583596f135aa8cd1138dc898bc5651ee35a92ebf89ab6aeb5366653bc60a70e0074fc11efe
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 89a553730433f7e6d67d16d373bd5360
|
||||||
|
IV = f724558db3433a523f4e51a5bea70497
|
||||||
|
PLAINTEXT = 807bc4ea684eedcfdcca30180680b0f1ae2814f35f36d053c5aea6595a386c1442770f4d7297d8b91825ee7237241da8925dd594ccf676aecd46ca2068e8d37a3a0ec8a7d5185a201e663b5ff36ae197110188a23503763b8218826d23ced74b31e9f6e2d7fbfa6cb43420c7807a8625
|
||||||
|
CIPHERTEXT = 406af1429a478c3d07e555c5287a60500d37fc39b68e5bbb9bafd6ddb223828561d6171a308d5b1a4551e8a5e7d572918d25c968d3871848d2f16635caa9847f38590b1df58ab5efb985f2c66cfaf86f61b3f9c0afad6c963c49cee9b8bc81a2ddb06c967f325515a4849eec37ce721a
|
||||||
|
|
||||||
|
COUNT = 7
|
||||||
|
KEY = c491ca31f91708458e29a925ec558d78
|
||||||
|
IV = 9ef934946e5cd0ae97bd58532cb49381
|
||||||
|
PLAINTEXT = cb6a787e0dec56f9a165957f81af336ca6b40785d9e94093c6190e5152649f882e874d79ac5e167bd2a74ce5ae088d2ee854f6539e0a94796b1e1bd4c9fcdbc79acbef4d01eeb89776d18af71ae2a4fc47dd66df6c4dbe1d1850e466549a47b636bcc7c2b3a62495b56bb67b6d455f1eebd9bfefecbca6c7f335cfce9b45cb9d
|
||||||
|
CIPHERTEXT = 7b2931f5855f717145e00f152a9f4794359b1ffcb3e55f594e33098b51c23a6c74a06c1d94fded7fd2ae42c7db7acaef5844cb33aeddc6852585ed0020a6699d2cb53809cefd169148ce42292afab063443978306c582c18b9ce0da3d084ce4d3c482cfd8fcf1a85084e89fb88b40a084d5e972466d07666126fb761f84078f2
|
||||||
|
|
||||||
|
COUNT = 8
|
||||||
|
KEY = f6e87d71b0104d6eb06a68dc6a71f498
|
||||||
|
IV = 1c245f26195b76ebebc2edcac412a2f8
|
||||||
|
PLAINTEXT = f82bef3c73a6f7f80db285726d691db6bf55eec25a859d3ba0e0445f26b9bb3b16a3161ed1866e4dd8f2e5f8ecb4e46d74a7a78c20cdfc7bcc9e479ba7a0caba9438238ad0c01651d5d98de37f03ddce6e6b4bd4ab03cf9e8ed818aedfa1cf963b932067b97d776dce1087196e7e913f7448e38244509f0caf36bd8217e15336d35c149fd4e41707893fdb84014f8729
|
||||||
|
CIPHERTEXT = b09512f3eff9ed0d85890983a73dadbb7c3678d52581be64a8a8fc586f490f2521297a478a0598040ebd0f5509fafb0969f9d9e600eaef33b1b93eed99687b167f89a5065aac439ce46f3b8d22d30865e64e45ef8cd30b6984353a844a11c8cd60dba0e8866b3ee30d24b3fa8a643b328353e06010fa8273c8fd54ef0a2b6930e5520aae5cd5902f9b86a33592ca4365
|
||||||
|
|
||||||
|
COUNT = 9
|
||||||
|
KEY = 2c14413751c31e2730570ba3361c786b
|
||||||
|
IV = 1dbbeb2f19abb448af849796244a19d7
|
||||||
|
PLAINTEXT = 40d930f9a05334d9816fe204999c3f82a03f6a0457a8c475c94553d1d116693adc618049f0a769a2eed6a6cb14c0143ec5cccdbc8dec4ce560cfd206225709326d4de7948e54d603d01b12d7fed752fb23f1aa4494fbb00130e9ded4e77e37c079042d828040c325b1a5efd15fc842e44014ca4374bf38f3c3fc3ee327733b0c8aee1abcd055772f18dc04603f7b2c1ea69ff662361f2be0a171bbdcea1e5d3f
|
||||||
|
CIPHERTEXT = 6be8a12800455a320538853e0cba31bd2d80ea0c85164a4c5c261ae485417d93effe2ebc0d0a0b51d6ea18633d210cf63c0c4ddbc27607f2e81ed9113191ef86d56f3b99be6c415a4150299fb846ce7160b40b63baf1179d19275a2e83698376d28b92548c68e06e6d994e2c1501ed297014e702cdefee2f656447706009614d801de1caaf73f8b7fa56cf1ba94b631933bbe577624380850f117435a0355b2b
|
||||||
|
|
||||||
|
[DECRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 6a7082cf8cda13eff48c8158dda206ae
|
||||||
|
IV = bd4172934078c2011cb1f31cffaf486e
|
||||||
|
CIPHERTEXT = f8eb31b31e374e960030cd1cadb0ef0c
|
||||||
|
PLAINTEXT = 940bc76d61e2c49dddd5df7f37fcf105
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = 625eefa18a4756454e218d8bfed56e36
|
||||||
|
IV = 73d9d0e27c2ec568fbc11f6a0998d7c8
|
||||||
|
CIPHERTEXT = 5d6fed86f0c4fe59a078d6361a142812514b295dc62ff5d608a42ea37614e6a1
|
||||||
|
PLAINTEXT = 360dc1896ce601dfb2a949250067aad96737847a4580ede2654a329b842fe81e
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = fd6e0b954ae2e3b723d6c9fcae6ab09b
|
||||||
|
IV = f08b65c9f4dd950039941da2e8058c4e
|
||||||
|
CIPHERTEXT = e29e3114c8000eb484395b256b1b3267894f290d3999819ff35da03e6463c186c4d7ebb964941f1986a2d69572fcaba8
|
||||||
|
PLAINTEXT = a206385945b21f812a9475f47fddbb7fbdda958a8d14c0dbcdaec36e8b28f1f6ececa1ceae4ce17721d162c1d42a66c1
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = 7b1ab9144b0239315cd5eec6c75663bd
|
||||||
|
IV = 0b1e74f45c17ff304d99c059ce5cde09
|
||||||
|
CIPHERTEXT = d3f89b71e033070f9d7516a6cb4ea5ef51d6fb63d4f0fea089d0a60e47bbb3c2e10e9ba3b282c7cb79aefe3068ce228377c21a58fe5a0f8883d0dbd3d096beca
|
||||||
|
PLAINTEXT = b968aeb199ad6b3c8e01f26c2edad444538c78bfa36ed68ca76123b8cdce615a01f6112bb80bfc3f17490578fb1f909a52e162637b062db04efee291a1f1af60
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = 36466b6bd25ea3857ea42f0cac1919b1
|
||||||
|
IV = 7186fb6bdfa98a16189544b228f3bcd3
|
||||||
|
CIPHERTEXT = 9ed957bd9bc52bba76f68cfbcde52157a8ca4f71ac050a3d92bdebbfd7c78316b4c9f0ba509fad0235fdafe90056ad115dfdbf08338b2acb1c807a88182dd2a882d1810d4302d598454e34ef2b23687d
|
||||||
|
PLAINTEXT = 999983467c47bb1d66d7327ab5c58f61ddb09b93bd2460cb78cbc12b5fa1ea0c5f759ccc5e478697687012ff4673f6e61eecaeda0ccad2d674d3098c7d17f887b62b56f56b03b4d055bf3a4460e83efa
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = 89373ee6e28397640d5082eed4123239
|
||||||
|
IV = 1a74d7c859672c804b82472f7e6d3c6b
|
||||||
|
CIPHERTEXT = 1bcba44ddff503db7c8c2ec4c4eea0e827957740cce125c1e11769842fa97e25f1b89269e6d77923a512a358312f4ba1cd33f2d111280cd83e1ef9e7cf7036d55048d5c273652afa611cc81b4e9dac7b5078b7c4716062e1032ead1e3329588a
|
||||||
|
PLAINTEXT = 45efd00daa4cdc8273ef785cae9e944a7664a2391e1e2c449f475acec0124bbc22944331678617408a1702917971f4654310ffb9229bec6173715ae512d37f93aaa6abf009f7e30d65669d1db0366b5bce4c7b00f871014f5753744a1878dc57
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = bab0cceddc0abd63e3f82e9fbff7b8aa
|
||||||
|
IV = 68b9140f300490c5c942f66e777eb806
|
||||||
|
CIPHERTEXT = c65b94b1f291fa9f0600f22c3c0432c895ad5d177bcccc9ea44e8ec339c9adf43855b326179d6d81aa36ef59462fd86127e9d81b0f286f93306bf74d4c79e47c1b3d4b74edd3a16290e3c63b742e41f20d66ceee794316bb63d3bd002712a1b136ba6185bd5c1dab81b07db90d2af5e5
|
||||||
|
PLAINTEXT = c5585ff215bbb73ba5393440852fb199436de0d15e55c631f877670aa3eda9f672eb1f876f09544e63558436b8928000db2f02a5ad90f95b05ac4cf49e198e617e7678480fdf0efacc6aae691271e6cdd3541ebf719a1ccaedb24e2f80f92455dd5910cb5086b0960a3942ec182dcbd7
|
||||||
|
|
||||||
|
COUNT = 7
|
||||||
|
KEY = 9c702898efa44557b29ed283f5bc0293
|
||||||
|
IV = cec6e1b82e8b2a591a9fa5ff1cf5cc51
|
||||||
|
CIPHERTEXT = ba9f646755dacc22911f51d7de2f7e7cb0bc0b75257ea44fe883edb055c7c28ede04c3a0adcb10128ad4517d0093fa16bb0bcd2635e7a0ba92c7609bc8d8568002a7a983473724d256513aa7d51b477aabec1975ab5faf2872a6407e922180eff02f1ef86a4591c8bd3d143da6f0ef0e4806f94ace0d5b0151c99640fccbc843
|
||||||
|
PLAINTEXT = 1d1f8d81bdc3e2c7cb057f408e6450000c5aaed3260ff1e87fbb6f324df6887ffd8f78d7e2a04c9ed9deda9d64482d2b002f4a2b78d8b4f691875c8295d4a64b22257ceaf713ed2f4b92530d7ad7151d629acda882b4829577a43990b0948c1149c22fe4273656d1b08833930e8b06709a94579a78fc220f7057bbc1fa9f6563
|
||||||
|
|
||||||
|
COUNT = 8
|
||||||
|
KEY = 5674636dbdb38f705f0b08c372ef4785
|
||||||
|
IV = 3f20ce0509b57420d53b6be4d0b7f0a9
|
||||||
|
CIPHERTEXT = 198351f453103face6655666fe90bdbd9630e3733b2d66c013a634e91f2bf015bd2d975d71b26322e44defa32d4e9dce50363557046ece08ba38f258dae5fd3e5049c647476c81e73482e40c171d89f9fea29452caf995733589b0061464fbd5dabe27dc5ea463a3deeb7dcb43664ae6a65c498c143883ab8e83b51e5410b181647602443dc3cfffe86f0205398fa83c
|
||||||
|
PLAINTEXT = 6d40fd2f908f48ce19241b6b278b1b1676dffd4a97ce9f8a1574c33bc59237deb536bee376fd6c381e6987700e39283aa111cf1a59f26fae6fb6700bf012646a2ab80239bf5e1632329043aa87d7911978b36523a2bc0bed9a9737ccf7a00baa2f3822b4e9e742e168e7069290705fed2eb63aa044b78f97dd33a8d6b24741ec1fd8c8db79d93b884e762dba0f406961
|
||||||
|
|
||||||
|
COUNT = 9
|
||||||
|
KEY = 97a1025529b9925e25bbe78770ca2f99
|
||||||
|
IV = d4b4eab92aa9637e87d366384ed6915c
|
||||||
|
CIPHERTEXT = 22cdc3306fcd4d31ccd32720cbb61bad28d855670657c48c7b88c31f4fa1f93c01b57da90be63ead67d6a325525e6ed45083e6fb70a53529d1fa0f55653b942af59d78a2660361d63a7290155ac5c43312a25b235dacbbc863faf00940c99624076dfa44068e7c554c9038176953e571751dfc0954d41d113771b06466b1c8d13e0d4cb675ed58d1a619e1540970983781dc11d2dd8525ab5745958d615defda
|
||||||
|
PLAINTEXT = e8b89150d8438bf5b17449d6ed26bd72127e10e4aa57cad85283e8359e089208e84921649f5b60ea21f7867cbc9620560c4c6238db021216db453c9943f1f1a60546173daef2557c3cdd855031b353d4bf176f28439e48785c37d38f270aa4a6faad2baabcb0c0b2d1dd5322937498ce803ba1148440a52e227ddba4872fe4d81d2d76a939d24755adb8a7b8452ceed2d179e1a5848f316f5c016300a390bfa7
|
||||||
|
|
1547
tests/LibHac.Tests/CryptoTests/TestVectors/CBCVarKey128.rsp
Normal file
1547
tests/LibHac.Tests/CryptoTests/TestVectors/CBCVarKey128.rsp
Normal file
File diff suppressed because it is too large
Load diff
1547
tests/LibHac.Tests/CryptoTests/TestVectors/CBCVarTxt128.rsp
Normal file
1547
tests/LibHac.Tests/CryptoTests/TestVectors/CBCVarTxt128.rsp
Normal file
File diff suppressed because it is too large
Load diff
20
tests/LibHac.Tests/CryptoTests/TestVectors/CTR128.rsp
Normal file
20
tests/LibHac.Tests/CryptoTests/TestVectors/CTR128.rsp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
[ENCRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = ae6852f8121067cc4bf7a5765577f39e
|
||||||
|
IV = 00000030000000000000000000000001
|
||||||
|
PLAINTEXT = 53696e676c6520626c6f636b206d7367
|
||||||
|
CIPHERTEXT = e4095d4fb7a7b3792d6175a3261311b8
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = 7e24067817fae0d743d6ce1f32539163
|
||||||
|
IV = 006cb6dbc0543b59da48d90b00000001
|
||||||
|
PLAINTEXT = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||||
|
CIPHERTEXT = 5104a106168a72d9790d41ee8edad388eb2e1efc46da57c8fce630df9141be28
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = 7691be035e5020a8ac6e618529f9a0dc
|
||||||
|
IV = 00e0017b27777f3f4a1786f000000001
|
||||||
|
PLAINTEXT = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20212223
|
||||||
|
CIPHERTEXT = c1cf48a89f2ffdd9cf4652e9efdb72d74540a42bde6d7836d59a5ceaaef3105325b2072f
|
||||||
|
|
81
tests/LibHac.Tests/CryptoTests/TestVectors/ECBGFSbox128.rsp
Normal file
81
tests/LibHac.Tests/CryptoTests/TestVectors/ECBGFSbox128.rsp
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
# CAVS 11.1
|
||||||
|
# Config info for aes_values
|
||||||
|
# AESVS GFSbox test data for ECB
|
||||||
|
# State : Encrypt and Decrypt
|
||||||
|
# Key Length : 128
|
||||||
|
# Generated on Fri Apr 22 15:11:26 2011
|
||||||
|
|
||||||
|
[ENCRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = f34481ec3cc627bacd5dc3fb08f273e6
|
||||||
|
CIPHERTEXT = 0336763e966d92595a567cc9ce537f5e
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 9798c4640bad75c7c3227db910174e72
|
||||||
|
CIPHERTEXT = a9a1631bf4996954ebc093957b234589
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 96ab5c2ff612d9dfaae8c31f30c42168
|
||||||
|
CIPHERTEXT = ff4f8391a6a40ca5b25d23bedd44a597
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 6a118a874519e64e9963798a503f1d35
|
||||||
|
CIPHERTEXT = dc43be40be0e53712f7e2bf5ca707209
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = cb9fceec81286ca3e989bd979b0cb284
|
||||||
|
CIPHERTEXT = 92beedab1895a94faa69b632e5cc47ce
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = b26aeb1874e47ca8358ff22378f09144
|
||||||
|
CIPHERTEXT = 459264f4798f6a78bacb89c15ed3d601
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
PLAINTEXT = 58c8e00b2631686d54eab84b91f0aca1
|
||||||
|
CIPHERTEXT = 08a4e2efec8a8e3312ca7460b9040bbf
|
||||||
|
|
||||||
|
[DECRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 0336763e966d92595a567cc9ce537f5e
|
||||||
|
PLAINTEXT = f34481ec3cc627bacd5dc3fb08f273e6
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = a9a1631bf4996954ebc093957b234589
|
||||||
|
PLAINTEXT = 9798c4640bad75c7c3227db910174e72
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = ff4f8391a6a40ca5b25d23bedd44a597
|
||||||
|
PLAINTEXT = 96ab5c2ff612d9dfaae8c31f30c42168
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = dc43be40be0e53712f7e2bf5ca707209
|
||||||
|
PLAINTEXT = 6a118a874519e64e9963798a503f1d35
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 92beedab1895a94faa69b632e5cc47ce
|
||||||
|
PLAINTEXT = cb9fceec81286ca3e989bd979b0cb284
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 459264f4798f6a78bacb89c15ed3d601
|
||||||
|
PLAINTEXT = b26aeb1874e47ca8358ff22378f09144
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 08a4e2efec8a8e3312ca7460b9040bbf
|
||||||
|
PLAINTEXT = 58c8e00b2631686d54eab84b91f0aca1
|
||||||
|
|
221
tests/LibHac.Tests/CryptoTests/TestVectors/ECBKeySbox128.rsp
Normal file
221
tests/LibHac.Tests/CryptoTests/TestVectors/ECBKeySbox128.rsp
Normal file
|
@ -0,0 +1,221 @@
|
||||||
|
# CAVS 11.1
|
||||||
|
# Config info for aes_values
|
||||||
|
# AESVS KeySbox test data for ECB
|
||||||
|
# State : Encrypt and Decrypt
|
||||||
|
# Key Length : 128
|
||||||
|
# Generated on Fri Apr 22 15:11:26 2011
|
||||||
|
|
||||||
|
[ENCRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 10a58869d74be5a374cf867cfb473859
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 6d251e6944b051e04eaa6fb4dbf78465
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = caea65cdbb75e9169ecd22ebe6e54675
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 6e29201190152df4ee058139def610bb
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = a2e2fa9baf7d20822ca9f0542f764a41
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = c3b44b95d9d2f25670eee9a0de099fa3
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = b6364ac4e1de1e285eaf144a2415f7a0
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 5d9b05578fc944b3cf1ccf0e746cd581
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = 64cf9c7abc50b888af65f49d521944b2
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = f7efc89d5dba578104016ce5ad659c05
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = 47d6742eefcc0465dc96355e851b64d9
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 0306194f666d183624aa230a8b264ae7
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 3eb39790678c56bee34bbcdeccf6cdb5
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 858075d536d79ccee571f7d7204b1f67
|
||||||
|
|
||||||
|
COUNT = 7
|
||||||
|
KEY = 64110a924f0743d500ccadae72c13427
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 35870c6a57e9e92314bcb8087cde72ce
|
||||||
|
|
||||||
|
COUNT = 8
|
||||||
|
KEY = 18d8126516f8a12ab1a36d9f04d68e51
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 6c68e9be5ec41e22c825b7c7affb4363
|
||||||
|
|
||||||
|
COUNT = 9
|
||||||
|
KEY = f530357968578480b398a3c251cd1093
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = f5df39990fc688f1b07224cc03e86cea
|
||||||
|
|
||||||
|
COUNT = 10
|
||||||
|
KEY = da84367f325d42d601b4326964802e8e
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = bba071bcb470f8f6586e5d3add18bc66
|
||||||
|
|
||||||
|
COUNT = 11
|
||||||
|
KEY = e37b1c6aa2846f6fdb413f238b089f23
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 43c9f7e62f5d288bb27aa40ef8fe1ea8
|
||||||
|
|
||||||
|
COUNT = 12
|
||||||
|
KEY = 6c002b682483e0cabcc731c253be5674
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 3580d19cff44f1014a7c966a69059de5
|
||||||
|
|
||||||
|
COUNT = 13
|
||||||
|
KEY = 143ae8ed6555aba96110ab58893a8ae1
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 806da864dd29d48deafbe764f8202aef
|
||||||
|
|
||||||
|
COUNT = 14
|
||||||
|
KEY = b69418a85332240dc82492353956ae0c
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = a303d940ded8f0baff6f75414cac5243
|
||||||
|
|
||||||
|
COUNT = 15
|
||||||
|
KEY = 71b5c08a1993e1362e4d0ce9b22b78d5
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = c2dabd117f8a3ecabfbb11d12194d9d0
|
||||||
|
|
||||||
|
COUNT = 16
|
||||||
|
KEY = e234cdca2606b81f29408d5f6da21206
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = fff60a4740086b3b9c56195b98d91a7b
|
||||||
|
|
||||||
|
COUNT = 17
|
||||||
|
KEY = 13237c49074a3da078dc1d828bb78c6f
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 8146a08e2357f0caa30ca8c94d1a0544
|
||||||
|
|
||||||
|
COUNT = 18
|
||||||
|
KEY = 3071a2a48fe6cbd04f1a129098e308f8
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 4b98e06d356deb07ebb824e5713f7be3
|
||||||
|
|
||||||
|
COUNT = 19
|
||||||
|
KEY = 90f42ec0f68385f2ffc5dfc03a654dce
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = 7a20a53d460fc9ce0423a7a0764c6cf2
|
||||||
|
|
||||||
|
COUNT = 20
|
||||||
|
KEY = febd9a24d8b65c1c787d50a4ed3619a9
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
CIPHERTEXT = f4a70d8af877f9b02b4c40df57d45b17
|
||||||
|
|
||||||
|
[DECRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 10a58869d74be5a374cf867cfb473859
|
||||||
|
CIPHERTEXT = 6d251e6944b051e04eaa6fb4dbf78465
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = caea65cdbb75e9169ecd22ebe6e54675
|
||||||
|
CIPHERTEXT = 6e29201190152df4ee058139def610bb
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = a2e2fa9baf7d20822ca9f0542f764a41
|
||||||
|
CIPHERTEXT = c3b44b95d9d2f25670eee9a0de099fa3
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = b6364ac4e1de1e285eaf144a2415f7a0
|
||||||
|
CIPHERTEXT = 5d9b05578fc944b3cf1ccf0e746cd581
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = 64cf9c7abc50b888af65f49d521944b2
|
||||||
|
CIPHERTEXT = f7efc89d5dba578104016ce5ad659c05
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = 47d6742eefcc0465dc96355e851b64d9
|
||||||
|
CIPHERTEXT = 0306194f666d183624aa230a8b264ae7
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 3eb39790678c56bee34bbcdeccf6cdb5
|
||||||
|
CIPHERTEXT = 858075d536d79ccee571f7d7204b1f67
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 7
|
||||||
|
KEY = 64110a924f0743d500ccadae72c13427
|
||||||
|
CIPHERTEXT = 35870c6a57e9e92314bcb8087cde72ce
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 8
|
||||||
|
KEY = 18d8126516f8a12ab1a36d9f04d68e51
|
||||||
|
CIPHERTEXT = 6c68e9be5ec41e22c825b7c7affb4363
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 9
|
||||||
|
KEY = f530357968578480b398a3c251cd1093
|
||||||
|
CIPHERTEXT = f5df39990fc688f1b07224cc03e86cea
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 10
|
||||||
|
KEY = da84367f325d42d601b4326964802e8e
|
||||||
|
CIPHERTEXT = bba071bcb470f8f6586e5d3add18bc66
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 11
|
||||||
|
KEY = e37b1c6aa2846f6fdb413f238b089f23
|
||||||
|
CIPHERTEXT = 43c9f7e62f5d288bb27aa40ef8fe1ea8
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 12
|
||||||
|
KEY = 6c002b682483e0cabcc731c253be5674
|
||||||
|
CIPHERTEXT = 3580d19cff44f1014a7c966a69059de5
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 13
|
||||||
|
KEY = 143ae8ed6555aba96110ab58893a8ae1
|
||||||
|
CIPHERTEXT = 806da864dd29d48deafbe764f8202aef
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 14
|
||||||
|
KEY = b69418a85332240dc82492353956ae0c
|
||||||
|
CIPHERTEXT = a303d940ded8f0baff6f75414cac5243
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 15
|
||||||
|
KEY = 71b5c08a1993e1362e4d0ce9b22b78d5
|
||||||
|
CIPHERTEXT = c2dabd117f8a3ecabfbb11d12194d9d0
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 16
|
||||||
|
KEY = e234cdca2606b81f29408d5f6da21206
|
||||||
|
CIPHERTEXT = fff60a4740086b3b9c56195b98d91a7b
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 17
|
||||||
|
KEY = 13237c49074a3da078dc1d828bb78c6f
|
||||||
|
CIPHERTEXT = 8146a08e2357f0caa30ca8c94d1a0544
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 18
|
||||||
|
KEY = 3071a2a48fe6cbd04f1a129098e308f8
|
||||||
|
CIPHERTEXT = 4b98e06d356deb07ebb824e5713f7be3
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 19
|
||||||
|
KEY = 90f42ec0f68385f2ffc5dfc03a654dce
|
||||||
|
CIPHERTEXT = 7a20a53d460fc9ce0423a7a0764c6cf2
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
||||||
|
COUNT = 20
|
||||||
|
KEY = febd9a24d8b65c1c787d50a4ed3619a9
|
||||||
|
CIPHERTEXT = f4a70d8af877f9b02b4c40df57d45b17
|
||||||
|
PLAINTEXT = 00000000000000000000000000000000
|
||||||
|
|
111
tests/LibHac.Tests/CryptoTests/TestVectors/ECBMMT128.rsp
Normal file
111
tests/LibHac.Tests/CryptoTests/TestVectors/ECBMMT128.rsp
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
# CAVS 11.1
|
||||||
|
# Config info for aes_values
|
||||||
|
# AESVS MMT test data for ECB
|
||||||
|
# State : Encrypt and Decrypt
|
||||||
|
# Key Length : 128
|
||||||
|
# Generated on Fri Apr 22 15:11:26 2011
|
||||||
|
|
||||||
|
[ENCRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = edfdb257cb37cdf182c5455b0c0efebb
|
||||||
|
PLAINTEXT = 1695fe475421cace3557daca01f445ff
|
||||||
|
CIPHERTEXT = 7888beae6e7a426332a7eaa2f808e637
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = 7723d87d773a8bbfe1ae5b081235b566
|
||||||
|
PLAINTEXT = 1b0a69b7bc534c16cecffae02cc5323190ceb413f1db3e9f0f79ba654c54b60e
|
||||||
|
CIPHERTEXT = ad5b089515e7821087c61652dc477ab1f2cc6331a70dfc59c9ffb0c723c682f6
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = 280afe063216a10b9cad9b2095552b16
|
||||||
|
PLAINTEXT = 6f172bb6ec364833411841a8f9ea2051735d600538a9ea5e8cd2431a432903c1d6178988b616ed76e00036c5b28ccd8b
|
||||||
|
CIPHERTEXT = 4cc2a8f13c8c7c36ed6a814db7f26900c7e04df49cbad916ce6a44d0ae4fe7edc0b402794675b3694933ebbc356525d8
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = ef60fb1400c83936414a25651eb51a1b
|
||||||
|
PLAINTEXT = 593559318cc66bf695e49feb42794bdfb66bce895ec222ca2609b133ecf66ac7344d13021e01e11a969c4684cbe20abae2b19d3ceb2cacd41419f21f1c865149
|
||||||
|
CIPHERTEXT = 3ea6f4305217bd47eebe773da4b578549cac744c00cbd8f9d596d38010304bd850cc2f4b19a91c2e022eabf100266185ca2705127815dfd46efbe4ecd46a3058
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = c5805cd1c4a7b98a715badb709720bf4
|
||||||
|
PLAINTEXT = 84f809fc5c84652376cc0df10095bc00b9f0547fa91a2d3310a0adbc9cc6191ade2aaa6fffa5e406af7223955f9277bfb06eb1dd2bbfbefe32ab342c36302bf22bc64e1b394032bbb5f4e6744f1bcbf2
|
||||||
|
CIPHERTEXT = a6dc096bc21b0658e416a0f679fefc6e958e9c56e3ce04fdf6e392c2db770a60d9523c255925e14a3e02a1002bf3875c2e501bac618bee1f55f9850454854eef9d693d90937cc8387b6f4c4414e2080b
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = 4c35be028e1475278346eae531cbee5c
|
||||||
|
PLAINTEXT = 7adcf4a494f6b09790c82c8bb97db62c5d3fa4032f06dfeceaad9ecb374b747bd1c08d07e78e351dc2eb99bfa714d23cffe31f5fb5a472e6e0252f35a20c304c4f6d0cf7d29c99444d40af3a00a92fc86c6444fcb80ce9765362ac1bdba0b10e
|
||||||
|
CIPHERTEXT = 22217953f71932ab4360d97ef495081559f1fcb09caca41fa0c65f7b1792b560eabe18f3b3b06ef80c41886f24c5d6d32d20427e83d8b5564d9ac7435a2842c1cf7c6fcc229eb7f518d3e0167d510efbaee39a0438fc800eb6acfc203c93280c
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 00cc73c990d376b82246e45ea3ae2e37
|
||||||
|
PLAINTEXT = 37a1205ea929355d2e4ee52d5e1d9cda279ae01e640287ccb153276e7e0ecf2d633cf4f2b3afaecb548a2590ce0445c6a168bac3dc601813eb74591bb1ce8dfcd740cdbb6388719e8cd283d9cc7e736938240b410dd5a6a48ba49dd2066503e63ab592ffdf3be49e7d2de74f82158b8c
|
||||||
|
CIPHERTEXT = c88e03383ba9da6f982c057fe92c0bb3ed5b9cd18295a100e13a4e12d440b919bbb8b221abead362902ce44d30d0b80e56bee1f66a7d8de0b1e1b4dbf76c90c1807a3bc5f277e9814c82ab120f7e10217dfdf6092ce4958f8906c5e32279c6537dd1fbae20cb7a1d9f89d0490b6aefc1
|
||||||
|
|
||||||
|
COUNT = 7
|
||||||
|
KEY = 0a53aa7a3e4a4f364e8c6c7224af5501
|
||||||
|
PLAINTEXT = eaf1760c0f25310dada6debeb966304db7a9f1b2d1c3af922623b263649031d299b3c56146d61d55b6ebf4cf8dd04039a4d1ace3146f49ee915f806afad64cbb2d04a64120de40382e2175dcae9480d1ca8dedc38fb64e4a40112f10f03a4c354fed01f2c5c7017dbd514b2d443a5adfd2e49c986723266cda41a69e6e459908
|
||||||
|
CIPHERTEXT = 5ece70a44da41bc7cfb9b582ea9ce0980030ec4af331e76499961f88860aa0554aba3ecbf77ca4293a3fee854a2caf3ae800343fb4521388b16b6dc599b3d60bf82777f98e1a8d04ab9cd54dd9a248095795d4dfe4858bfd9a05f54c795bb086e15f7c22228184ec66a9ca10b1cf71a6bb9303c5cd1dcc056460a86df651f053
|
||||||
|
|
||||||
|
COUNT = 8
|
||||||
|
KEY = b80bcc929052cb5450479442e2b809ce
|
||||||
|
PLAINTEXT = 8177d79c8f239178186b4dc5f1df2ea7fee7d0db535489ef983aefb3b2029aeba0bb2b46a2b18c94a1417a33cbeb41ca7ea9c73a677fccd2eb5470c3c500f6d3f1a6c755c944ba586f88921f6ae6c9d194e78c7233c406126633e144c3810ad23ee1b5af4c04a22d49e99e7017f74c2309492569ff49be17d2804920f2ac5f514d13fd3e7318cc7cf80ca5101a465428
|
||||||
|
CIPHERTEXT = 5befb3062a7a7246af1f77b0ec0ac614e28be06ac2c81b19e5a0481bf160f9f2bc43f28f6548787639e4ce3e0f1e95475f0e81ceb793004c8e46670ebd48b866d5b43d104874ead4be8a236bf90b48f862f7e252dec4475fdbb841a662efcd25ed64b2910e9baaea9466e413a4241438b31df0bd3df9a16f4641636754e259861728aa7ddf435cc51f54f79a1db25f52
|
||||||
|
|
||||||
|
COUNT = 9
|
||||||
|
KEY = ebea9c6a82213a00ac1d22faea22116f
|
||||||
|
PLAINTEXT = 451f45663b44fd005f3c288ae57b383883f02d9ad3dc1715f9e3d6948564257b9b06d7dd51935fee580a96bbdfefb918b4e6b1daac809847465578cb8b5356ed38556f801ff7c11ecba9cdd263039c15d05900fc228e1caf302d261d7fb56cee663595b96f192a78ff4455393a5fe8162170a066fdaeac35019469f22b3470686bced2f007a1a2e43e01b4562caaa502ed541b8205874ec1ffb1c8b255766942
|
||||||
|
CIPHERTEXT = 01043053f832ef9b911ed387ba577451e30d51d4b6b11f319d4cd539d067b7f4f9b4f41f7f3d4e920c57cbe2b5e1885aa66203ae493e93a1df63793a9563c176bc6775dd09cc9161e278a01beb8fd8a19200326bd95abc5f716768e34f90b50523d30fdabb103a3bc020afbbb0cb3bd2ad512a6fea79f8d64cef347458dec48be89451cb0b807d73593f273d9fc521b789a77524404f43e00f20b3b77b938b1a
|
||||||
|
|
||||||
|
[DECRYPT]
|
||||||
|
|
||||||
|
COUNT = 0
|
||||||
|
KEY = 54b760dd2968f079ac1d5dd20626445d
|
||||||
|
CIPHERTEXT = 065bd5a9540d22d5d7b0f75d66cb8b30
|
||||||
|
PLAINTEXT = 46f2c98932349c338e9d67f744a1c988
|
||||||
|
|
||||||
|
COUNT = 1
|
||||||
|
KEY = bce4c486cc4a12622b9147df9bca452c
|
||||||
|
CIPHERTEXT = 76fa67e121894dbc2ad85ae7f9c5c44d14ccee5b87d5e7708950338f5c84cf58
|
||||||
|
PLAINTEXT = 8c8e6ed8a6bdb3baabec78189b7d61010d6d168de2c08ec56f9b9c004a191e21
|
||||||
|
|
||||||
|
COUNT = 2
|
||||||
|
KEY = 279161759d29e92dc8f1fafd8d45533d
|
||||||
|
CIPHERTEXT = 1ce69ab7624fed511fb42b8fb639f566d72783f9ab49801651961b048e0f5b7cc0ebb2f514f2d625f927ccc4d5a94593
|
||||||
|
PLAINTEXT = 8838058bd98072b72fd75641edb216301fee8323ff8c4ba18ee6a4623c2fdeb3df5f8a240a8e7e6d5ae15444614f41fb
|
||||||
|
|
||||||
|
COUNT = 3
|
||||||
|
KEY = 9ba852520c9fd1eb367b6ad2aed07abd
|
||||||
|
CIPHERTEXT = 6c53489f6a4bd0f7cd15d20f6ebc7e649fd95b76b107e6daba967c8a9484797f29a8a282ee31c03fae4f8e9b8930d5473c2ed695a347e88b7ccd62376d5ebb41
|
||||||
|
PLAINTEXT = 6061df5bcd421fabdb5235fc032502650448fd8233a0237c5f6f249a63d7db3e4283ac9a8684a363ef64e760c5886564659da619466851568b32091df5516f57
|
||||||
|
|
||||||
|
COUNT = 4
|
||||||
|
KEY = cd6a33abb95d7ab92980f9c2b810c90f
|
||||||
|
CIPHERTEXT = 33cb1a98ce4be97f5b222aa861c945643f372687cbf7f8193a7d304e40baceb877eedfbc05be47437a86bdb1f7f0171b95c6c8b50404a7897332f26fb0f0923991d3a02e926f29babfb52e63d580efff
|
||||||
|
PLAINTEXT = 3f098ae7e7524ddb556403c5d3d0b10e5db6c324843ca54a47e34ad9bdbccc93a645e96f2e98651751f0f1a697398ea801a69079c1808b6a8e3bb02a4cf3292f1a7a05b954571339f7899f9aaa2ae1e9
|
||||||
|
|
||||||
|
COUNT = 5
|
||||||
|
KEY = ff71b9f6311a44072ddb1a77488c4870
|
||||||
|
CIPHERTEXT = 19d76b386a7715dec7aad8bb01d126c7385a4387f087faec67718f78274cf4a2d7ec3f7c56885c930bbfff1676d8dd3b0b4e1cdf418c086de6f50700b527cfcc2a81d6ba95e30a526eb4c3dee82af6ccc8c5ab55781db15c57de90995411bff6
|
||||||
|
PLAINTEXT = 3dfe918048f4c0b0b22fbc55e5af751cf3e6ce348eb9a888795033f6dd216afbea65fc8df41c0ce6c7316a8183d36060bf19709fe2bec6d13bbdf1a434cc5b8f10aadb368c269d2dc4474a1f8112640fe52803b1883cb7756743100a758dd862
|
||||||
|
|
||||||
|
COUNT = 6
|
||||||
|
KEY = 8ec6a5a054fea2fc8dafb5939a4bd788
|
||||||
|
CIPHERTEXT = 4d6f972946a2e4ca05bfbeecd00535ece6c81ed963c4167063b1c34b6a185d5504646d81a83cd5bce2101120b2f2bc6a2fa856ae6fff4449ab6218189faa13e73038e82c5141c3f6276a8a206b9563ca11fa76092779f4deff2e58659047ed4f1a129092095ab75f1cf4b255c69531f4
|
||||||
|
PLAINTEXT = 6e19cec775595c2f768de3bda3682fb4026ed1889fc3de11bc45a2a3e2b22694ddaab3274c81b29204fa034eedac564a7dfe27aabb6ff420f9aa5abadf15c74676efeabd96a7ff2491813ba53cb5ab76eacd37255a28daecbbe580f5eb77f9bc0339e0da59b2b307f52974b6182cb106
|
||||||
|
|
||||||
|
COUNT = 7
|
||||||
|
KEY = b53e54b1b09f78abcd6afac1f7e7cda9
|
||||||
|
CIPHERTEXT = 447557bd1561b09a082cabdbf49b0612b46c9793db3c987aa4a843ef28b39fa8d46799b019c0566765c5c8cb53f87ff51ff0c2e65c45df84e9acbfe02163bdba52d0b847706567320bc6ede07f2eaef86b0f602364f86510eabc58bc9ad1e6f0a6f6df0b83188c01e17744a4e0053a22810e99cf5a1ed3258f203509fdc3c050
|
||||||
|
PLAINTEXT = 398db04b45a724393e4baec86a220f22358df1bbf0cab278dcfecf7a3f8f6275ef45ed9f039bc1f5030c3a0c245fbb6ea0bff3e2da0859ac498db6624a572023de7c221bf3567f51e98947970dfc581b3ca670ab92953d3bdd97dbf5d6bef8aa2f31500d221198ed9f23b049eaeed67683083034b4a5a82a0e49319e368c6f55
|
||||||
|
|
||||||
|
COUNT = 8
|
||||||
|
KEY = 9e79b681c57d7feb7db7e8a6ad41382c
|
||||||
|
CIPHERTEXT = fa2e97bed2f0b76ed2f8c1275f6d50ecfc1131240622ba9da17e5dd0f20a7d678f537ffc33762524b73e17ac3d8dc322affd679768c66ca430e3f6ab6e70b95f99570e87f02b46ff6b543efff16d339fcbead89b59fea65403bc7418737c47a301806be66fd7c307d7825da8e1d6496c3921acb7419010b60350fea069f4cf3bb017bfa11a424344e3109d30778fad90
|
||||||
|
PLAINTEXT = a2e19c08fa204640b1bc73beac58f81a7923f3ef2a0affcf1568c9179d816cf1bd16b79418f0266f0ff904e06045f276df187ed72b8f6641b065b854a7d3f152b8e153cd77ec605e5b75454245745dc0e0dcfc616f5246f868b6ee5a1df56c4906c5c34bc42309d370733e50d9a1addc3f37cbe4b331ac7d3a920c794484a16b05599f46f42046a6dc9063b1d5a8ae1f
|
||||||
|
|
||||||
|
COUNT = 9
|
||||||
|
KEY = 44f0ee626d0446e0a3924cfb078944bb
|
||||||
|
CIPHERTEXT = 931b2f5f3a5820d53a6beaaa6431083a3488f4eb03b0f5b57ef838e1579623103bd6e6800377538b2e51ef708f3c4956432e8a8ee6a34e190642b26ad8bdae6c2af9a6c7996f3b6004d2671e41f1c9f40ee03d1c4a52b0a0654a331f15f34dce4acb96bd6507815ca4347a3de11a311b7de5351c9787c4538158e28974ffa83d8296dfe9cd09cd87f7bf4f54d97d28d4788799163408323943b3e72f5eab66c1
|
||||||
|
PLAINTEXT = 9c29eecb2de04254fafb896a994102d1da30ddb49d82728eb23dbd029901e9b75b3d0aee03f7a05f6c852d8fada0b5c28e8c9aed334fad11829df3dfadc5c2e471eb41af9e48a8a465e03d5ebdb0216915081f3b5a0ebb2308dfc2d28e5a8ba3f32adae4c3575921bc657b63d46ba5a618880ee9ad8af3fba5643a5026facd7d667ce599327f936cdda7e1bb742a33a019990b76be648a6ec725daed540ed9e7
|
||||||
|
|
1291
tests/LibHac.Tests/CryptoTests/TestVectors/ECBVarKey128.rsp
Normal file
1291
tests/LibHac.Tests/CryptoTests/TestVectors/ECBVarKey128.rsp
Normal file
File diff suppressed because it is too large
Load diff
1291
tests/LibHac.Tests/CryptoTests/TestVectors/ECBVarTxt128.rsp
Normal file
1291
tests/LibHac.Tests/CryptoTests/TestVectors/ECBVarTxt128.rsp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -16,6 +16,10 @@
|
||||||
<ProjectReference Include="..\..\src\LibHac\LibHac.csproj" />
|
<ProjectReference Include="..\..\src\LibHac\LibHac.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="CryptoTests\TestVectors\*.rsp" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0-preview.2" />
|
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0-preview.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
Loading…
Reference in a new issue