From e553818e00684e8905ede16e53aa490c153b7e7a Mon Sep 17 00:00:00 2001 From: weidai Date: Sat, 9 Dec 2006 17:18:13 +0000 Subject: add Salsa20 cipher git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@247 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- datatest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'datatest.cpp') diff --git a/datatest.cpp b/datatest.cpp index 79609e8..32b10fb 100644 --- a/datatest.cpp +++ b/datatest.cpp @@ -265,6 +265,9 @@ void TestSymmetricCipher(TestData &v) { std::auto_ptr encryptor(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); encryptor->SetKey((const byte *)key.data(), key.size(), pairs); + int seek = pairs.GetIntValueWithDefault("Seek", 0); + if (seek) + encryptor->Seek(seek); std::string encrypted; StringSource ss(plaintext, true, new StreamTransformationFilter(*encryptor, new StringSink(encrypted), StreamTransformationFilter::NO_PADDING)); if (encrypted != ciphertext) @@ -274,6 +277,9 @@ void TestSymmetricCipher(TestData &v) { std::auto_ptr decryptor(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); decryptor->SetKey((const byte *)key.data(), key.size(), pairs); + int seek = pairs.GetIntValueWithDefault("Seek", 0); + if (seek) + decryptor->Seek(seek); std::string decrypted; StringSource ss(ciphertext, true, new StreamTransformationFilter(*decryptor, new StringSink(decrypted), StreamTransformationFilter::NO_PADDING)); if (decrypted != plaintext) -- cgit v1.2.1