summaryrefslogtreecommitdiff
path: root/dlltest.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2004-04-29 16:00:39 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2004-04-29 16:00:39 +0000
commit8292126d81f89e703e3c92f1fc8c8bf1f5d9c4a8 (patch)
tree230a162876fc2fca3a4924b96cd92773b6600e77 /dlltest.cpp
parentf0e00c67ca788de19b18cac39ed3fdc904dbc811 (diff)
downloadcryptopp-8292126d81f89e703e3c92f1fc8c8bf1f5d9c4a8.tar.gz
add CFB mode FIPS variant
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@165 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'dlltest.cpp')
-rw-r--r--dlltest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/dlltest.cpp b/dlltest.cpp
index a8b2813..ed9337a 100644
--- a/dlltest.cpp
+++ b/dlltest.cpp
@@ -60,20 +60,20 @@ void FIPS140_SampleApplication()
byte ciphertext[24];
byte decrypted[24];
- CFB_Mode<DES_EDE3>::Encryption encryption_DES_EDE3_CBC;
- encryption_DES_EDE3_CBC.SetKeyWithIV(key, sizeof(key), iv);
- encryption_DES_EDE3_CBC.ProcessString(ciphertext, plaintext, 24);
+ CFB_FIPS_Mode<DES_EDE3>::Encryption encryption_DES_EDE3_CFB;
+ encryption_DES_EDE3_CFB.SetKeyWithIV(key, sizeof(key), iv);
+ encryption_DES_EDE3_CFB.ProcessString(ciphertext, plaintext, 23);
- CFB_Mode<DES_EDE3>::Decryption decryption_DES_EDE3_CBC;
- decryption_DES_EDE3_CBC.SetKeyWithIV(key, sizeof(key), iv);
- decryption_DES_EDE3_CBC.ProcessString(decrypted, ciphertext, 24);
+ CFB_FIPS_Mode<DES_EDE3>::Decryption decryption_DES_EDE3_CFB;
+ decryption_DES_EDE3_CFB.SetKeyWithIV(key, sizeof(key), iv);
+ decryption_DES_EDE3_CFB.ProcessString(decrypted, ciphertext, 24);
if (memcmp(plaintext, decrypted, 24) != 0)
{
- cerr << "DES-EDE3-CBC Encryption/decryption failed.\n";
+ cerr << "DES-EDE3-CFB Encryption/decryption failed.\n";
abort();
}
- cout << "3. DES-EDE3-CBC Encryption/decryption succeeded.\n";
+ cout << "3. DES-EDE3-CFB Encryption/decryption succeeded.\n";
// hash
const byte message[] = {'a', 'b', 'c'};