summaryrefslogtreecommitdiff
path: root/dlltest.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2004-04-29 16:00:39 +0000
committerweidai <weidai11@users.noreply.github.com>2004-04-29 16:00:39 +0000
commitafb08eb452e78d288db14004948bbfd8a26c5922 (patch)
tree230a162876fc2fca3a4924b96cd92773b6600e77 /dlltest.cpp
parent5fc752d268152ac25a0cb36517ec960a4fddd61c (diff)
downloadcryptopp-git-afb08eb452e78d288db14004948bbfd8a26c5922.tar.gz
add CFB mode FIPS variant
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 a8b28133..ed9337a0 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'};