diff options
| author | Jeffrey Walton <noloader@gmail.com> | 2017-05-15 21:02:47 -0400 |
|---|---|---|
| committer | Jeffrey Walton <noloader@gmail.com> | 2017-05-15 21:02:47 -0400 |
| commit | 4da06919ebd871b14a5f072a3988986ada98486d (patch) | |
| tree | a1b85c29a9165d65e58f09015ba56ba3ad162c8b /datatest.cpp | |
| parent | 30ac06dd0dda9d8d6145710b750b1f647842c353 (diff) | |
| download | cryptopp-git-4da06919ebd871b14a5f072a3988986ada98486d.tar.gz | |
Switch conversion switch from 'ce' to 'cvt'
There were some collisions in the RSA test vectors
Diffstat (limited to 'datatest.cpp')
| -rw-r--r-- | datatest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/datatest.cpp b/datatest.cpp index b1f05430..d4e7cb36 100644 --- a/datatest.cpp +++ b/datatest.cpp @@ -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;
}
|
