aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-05-10 17:15:40 +0000
committerlloyd <[email protected]>2010-05-10 17:15:40 +0000
commitfc67598e890b930cf298102fc140417e5c5f4da3 (patch)
tree438ec9b4bf0188b2c64b9fafc48393fda9d799e1
parent75e9bcad2f3a8a42f5b4579db7034a35e15fc872 (diff)
parent1bebe3df43f1f60ef64102ef808ce66f34f9a578 (diff)
merge of '22c256e152c9765e98afa4d164af3f6783e96257'
and '561b7dbb17d3809ca98a31b718ee55ae9d52cb2c'
-rw-r--r--checks/bench.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/checks/bench.cpp b/checks/bench.cpp
index cfb44070d..d3f9be391 100644
--- a/checks/bench.cpp
+++ b/checks/bench.cpp
@@ -179,10 +179,17 @@ bool bench_algo(const std::string& algo,
std::string cipher = algo_parts[0];
- u32bit cipher_keylen =
- af.prototype_block_cipher(cipher)->MAXIMUM_KEYLENGTH;
- u32bit cipher_ivlen =
- af.prototype_block_cipher(cipher)->BLOCK_SIZE;
+ const Botan::BlockCipher* proto_cipher =
+ af.prototype_block_cipher(cipher);
+
+ if(!proto_cipher)
+ {
+ std::cout << "Unknown algorithm " << cipher << "\n";
+ return false;
+ }
+
+ u32bit cipher_keylen = proto_cipher->MAXIMUM_KEYLENGTH;
+ u32bit cipher_ivlen = proto_cipher->BLOCK_SIZE;
if(algo_parts[1] == "XTS")
cipher_keylen *= 2; // hack!