aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_cryptobox.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-01-07 11:03:55 +0000
committerlloyd <[email protected]>2014-01-07 11:03:55 +0000
commitc109c7f84fcef6ba895c6293508b2deae0e803c1 (patch)
tree35ba7b55914023a77ecfbcf5dee2befcc4e275d1 /src/tests/test_cryptobox.cpp
parenta7e3abf95fd1bc3df45be6fc9cb82e28e0a727ea (diff)
Rename test sources
Diffstat (limited to 'src/tests/test_cryptobox.cpp')
-rw-r--r--src/tests/test_cryptobox.cpp45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/tests/test_cryptobox.cpp b/src/tests/test_cryptobox.cpp
deleted file mode 100644
index 9a53da74c..000000000
--- a/src/tests/test_cryptobox.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "tests.h"
-
-#include <botan/auto_rng.h>
-#include <iostream>
-
-#if defined(BOTAN_HAS_CRYPTO_BOX)
- #include <botan/cryptobox.h>
-#endif
-
-using namespace Botan;
-
-size_t test_cryptobox()
- {
- size_t fails = 0;
-
-#if defined(BOTAN_HAS_CRYPTO_BOX)
- AutoSeeded_RNG rng;
-
- const byte msg[] = { 0xAA, 0xBB, 0xCC };
- std::string ciphertext = CryptoBox::encrypt(msg, sizeof(msg),
- "secret password",
- rng);
-
- try
- {
- std::string plaintext = CryptoBox::decrypt(ciphertext,
- "secret password");
-
- if(plaintext.size() != sizeof(msg) ||
- !same_mem(reinterpret_cast<const byte*>(&plaintext[0]), msg, sizeof(msg)))
- ++fails;
-
- }
- catch(std::exception& e)
- {
- std::cout << "Error during Cryptobox test " << e.what() << "\n";
- ++fails;
- }
-
- test_report("Cryptobox", 1, fails);
-#endif
-
- return fails;
- }
-