summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2006-12-09 17:18:13 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2006-12-09 17:18:13 +0000
commite553818e00684e8905ede16e53aa490c153b7e7a (patch)
tree6b3af3bcbac76ed5587c17adfe5399fd2059378e /datatest.cpp
parentbbd05f8142921b590d6493ff37983fa687aa90e3 (diff)
downloadcryptopp-e553818e00684e8905ede16e53aa490c153b7e7a.tar.gz
add Salsa20 cipher
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@247 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'datatest.cpp')
-rw-r--r--datatest.cpp6
1 files changed, 6 insertions, 0 deletions
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<SymmetricCipher> encryptor(ObjectFactoryRegistry<SymmetricCipher, ENCRYPTION>::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<SymmetricCipher> decryptor(ObjectFactoryRegistry<SymmetricCipher, DECRYPTION>::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)