From 4da06919ebd871b14a5f072a3988986ada98486d Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 15 May 2017 21:02:47 -0400 Subject: [PATCH] Switch conversion switch from 'ce' to 'cvt' There were some collisions in the RSA test vectors --- datatest.cpp | 9 +++++---- 1 file 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; }