diff options
author | lloyd <[email protected]> | 2008-09-30 06:20:10 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-30 06:20:10 +0000 |
commit | 33bb3dca54ecef2599b756d27b66781e14d06ae3 (patch) | |
tree | 4c7b07a1b1b3f40e82202570c7aec298a672339c /src/rng/randpool/randpool.cpp | |
parent | c9749d5d4693b5d93171f6085b29fc72c1e12ba0 (diff) |
Remove lookup from Randpool, HMAC, CMAC, CBC-MAC, TLS-PRF, and PBKDF2
Diffstat (limited to 'src/rng/randpool/randpool.cpp')
-rw-r--r-- | src/rng/randpool/randpool.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/rng/randpool/randpool.cpp b/src/rng/randpool/randpool.cpp index 69ef3b9e7..d7d1763ec 100644 --- a/src/rng/randpool/randpool.cpp +++ b/src/rng/randpool/randpool.cpp @@ -4,7 +4,6 @@ *************************************************/ #include <botan/randpool.h> -#include <botan/lookup.h> #include <botan/loadstor.h> #include <botan/xor_buf.h> #include <botan/util.h> @@ -180,13 +179,15 @@ std::string Randpool::name() const /************************************************* * Randpool Constructor * *************************************************/ -Randpool::Randpool(const std::string& cipher_name, - const std::string& mac_name) : - ITERATIONS_BEFORE_RESEED(128), POOL_BLOCKS(32) +Randpool::Randpool(BlockCipher* cipher_in, + MessageAuthenticationCode* mac_in, + u32bit pool_blocks, + u32bit iter_before_reseed) : + ITERATIONS_BEFORE_RESEED(iter_before_reseed), + POOL_BLOCKS(pool_blocks), + cipher(cipher_in), + mac(mac_in) { - cipher = get_block_cipher(cipher_name); - mac = get_mac(mac_name); - const u32bit BLOCK_SIZE = cipher->BLOCK_SIZE; const u32bit OUTPUT_LENGTH = mac->OUTPUT_LENGTH; @@ -197,7 +198,7 @@ Randpool::Randpool(const std::string& cipher_name, delete cipher; delete mac; throw Internal_Error("Randpool: Invalid algorithm combination " + - cipher_name + "/" + mac_name); + cipher->name() + "/" + mac->name()); } buffer.create(BLOCK_SIZE); |