Switch conversion switch from 'ce' to 'cvt'

There were some collisions in the RSA test vectors
pull/186/merge
Jeffrey Walton 2017-05-15 21:02:47 -04:00
parent 30ac06dd0d
commit 4da06919eb
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 5 additions and 4 deletions

View File

@ -116,16 +116,17 @@ void PutDecodedDatumInto(const TestData &data, const char *name, BufferedTransfo
s1 = s1.substr(s1.find(' ')+1);
}
// Use like this (from Threefish test vectors, which supplies byte-reversed values):
// Key: ce BC2560EFC6BBA2B1 E3361F162238EB40 FB8631EE0ABBD175 7B9479D4C5479ED1
// The 'ce' means BC2560EFC6BBA2B1 will be processed into B1A2BBC6EF6025BC.
if (s1.length() >= 3 && s1.substr(0,3) == "ce ")
// Convert endian order. Use it with 64-bit words like this:
// Key: cvt BC2560EFC6BBA2B1 E3361F162238EB40 FB8631EE0ABBD175 7B9479D4C5479ED1
// BC2560EFC6BBA2B1 will be processed into B1A2BBC6EF6025BC.
if (s1.length() >= 3 && s1.substr(0,3) == "cvt")
{
word64 value;
std::istringstream iss(s1.substr(3));
while (iss >> std::hex >> value)
q.Put((const byte *)&value, 8);
s1.clear(); s2.clear();
goto end;
}