mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-27 03:40:22 +00:00
Update datatest.cpp
This commit is contained in:
parent
0c412ee900
commit
9f046c2768
11
datatest.cpp
11
datatest.cpp
@ -484,7 +484,7 @@ void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters)
|
|||||||
// Most block ciphers don't specify BlockPaddingScheme. Kalyna uses it in test vectors.
|
// Most block ciphers don't specify BlockPaddingScheme. Kalyna uses it in test vectors.
|
||||||
// 0 is NoPadding, 1 is ZerosPadding, 2 is PkcsPadding, 3 is OneAndZerosPadding, etc
|
// 0 is NoPadding, 1 is ZerosPadding, 2 is PkcsPadding, 3 is OneAndZerosPadding, etc
|
||||||
// Note: The machinery is wired such that paddingScheme is effectively latched. An
|
// Note: The machinery is wired such that paddingScheme is effectively latched. An
|
||||||
// old paddingScheme may be unintentionally used in a subsequent test.
|
// old paddingScheme may be unintentionally used in a subsequent test.
|
||||||
int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);
|
int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);
|
||||||
|
|
||||||
ConstByteArrayParameter iv;
|
ConstByteArrayParameter iv;
|
||||||
@ -623,6 +623,7 @@ void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: figure out what is going on with chacha_tls.
|
||||||
void TestSymmetricCipherWithFileSource(TestData &v, const NameValuePairs &overrideParameters)
|
void TestSymmetricCipherWithFileSource(TestData &v, const NameValuePairs &overrideParameters)
|
||||||
{
|
{
|
||||||
std::string name = GetRequiredDatum(v, "Name");
|
std::string name = GetRequiredDatum(v, "Name");
|
||||||
@ -662,7 +663,7 @@ void TestSymmetricCipherWithFileSource(TestData &v, const NameValuePairs &overri
|
|||||||
// Most block ciphers don't specify BlockPaddingScheme. Kalyna uses it in test vectors.
|
// Most block ciphers don't specify BlockPaddingScheme. Kalyna uses it in test vectors.
|
||||||
// 0 is NoPadding, 1 is ZerosPadding, 2 is PkcsPadding, 3 is OneAndZerosPadding, etc
|
// 0 is NoPadding, 1 is ZerosPadding, 2 is PkcsPadding, 3 is OneAndZerosPadding, etc
|
||||||
// Note: The machinery is wired such that paddingScheme is effectively latched. An
|
// Note: The machinery is wired such that paddingScheme is effectively latched. An
|
||||||
// old paddingScheme may be unintentionally used in a subsequent test.
|
// old paddingScheme may be unintentionally used in a subsequent test.
|
||||||
int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);
|
int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);
|
||||||
|
|
||||||
ConstByteArrayParameter iv;
|
ConstByteArrayParameter iv;
|
||||||
@ -708,11 +709,13 @@ void TestSymmetricCipherWithFileSource(TestData &v, const NameValuePairs &overri
|
|||||||
|
|
||||||
//StringStore pstore(plaintext);
|
//StringStore pstore(plaintext);
|
||||||
//RandomizedTransfer(pstore, encFilter, true);
|
//RandomizedTransfer(pstore, encFilter, true);
|
||||||
// encFilter.MessageEnd();
|
//encFilter.MessageEnd();
|
||||||
|
|
||||||
std::string testFilename = "test.dat";
|
std::string testFilename = "test.dat";
|
||||||
StringSource(plaintext, true, new FileSink(testFilename.c_str()));
|
StringSource(plaintext, true, new FileSink(testFilename.c_str()));
|
||||||
FileSource(testFilename.c_str(), true, new Redirector(encFilter));
|
|
||||||
|
FileSource pstore(testFilename.c_str(), true);
|
||||||
|
RandomizedTransfer(pstore, encFilter, true);
|
||||||
encFilter.MessageEnd();
|
encFilter.MessageEnd();
|
||||||
|
|
||||||
ciphertext = GetDecodedDatum(v, "Ciphertext");
|
ciphertext = GetDecodedDatum(v, "Ciphertext");
|
||||||
|
Loading…
Reference in New Issue
Block a user