diff options
author | lloyd <[email protected]> | 2010-10-13 15:04:48 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 15:04:48 +0000 |
commit | 30a71cfa8d2d4c78e3a2b9f4c394b652f457e1f2 (patch) | |
tree | e85eca2f184c1fc399c8fec932420fdeb4622a5a /src | |
parent | bb53c6169463a67cc751625cb0a2c47df129a2ab (diff) |
Compile fix
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/openssl/ossl_bc.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/engine/openssl/ossl_bc.cpp b/src/engine/openssl/ossl_bc.cpp index 891927b9f..64b5fa3b4 100644 --- a/src/engine/openssl/ossl_bc.cpp +++ b/src/engine/openssl/ossl_bc.cpp @@ -1,6 +1,6 @@ /* * OpenSSL Block Cipher -* (C) 1999-2007 Jack Lloyd +* (C) 1999-2010 Jack Lloyd * * Distributed under the terms of the Botan license */ @@ -21,7 +21,11 @@ class EVP_BlockCipher : public BlockCipher void clear(); std::string name() const { return cipher_name; } BlockCipher* clone() const; + + size_t block_size() const { return block_sz; } + EVP_BlockCipher(const EVP_CIPHER*, const std::string&); + EVP_BlockCipher(const EVP_CIPHER*, const std::string&, u32bit, u32bit, u32bit); @@ -30,6 +34,8 @@ class EVP_BlockCipher : public BlockCipher void encrypt_n(const byte in[], byte out[], size_t blocks) const; void decrypt_n(const byte in[], byte out[], size_t blocks) const; void key_schedule(const byte[], size_t); + + size_t block_sz; std::string cipher_name; mutable EVP_CIPHER_CTX encrypt, decrypt; }; @@ -39,7 +45,8 @@ class EVP_BlockCipher : public BlockCipher */ EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* algo, const std::string& algo_name) : - BlockCipher(EVP_CIPHER_block_size(algo), EVP_CIPHER_key_length(algo)), + BlockCipher(EVP_CIPHER_key_length(algo)), + block_sz(EVP_CIPHER_block_size(algo)), cipher_name(algo_name) { if(EVP_CIPHER_mode(algo) != EVP_CIPH_ECB_MODE) @@ -62,7 +69,8 @@ EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* algo, const std::string& algo_name, u32bit key_min, u32bit key_max, u32bit key_mod) : - BlockCipher(EVP_CIPHER_block_size(algo), key_min, key_max, key_mod), + BlockCipher(key_min, key_max, key_mod), + block_sz(EVP_CIPHER_block_size(algo)), cipher_name(algo_name) { if(EVP_CIPHER_mode(algo) != EVP_CIPH_ECB_MODE) @@ -94,7 +102,7 @@ void EVP_BlockCipher::encrypt_n(const byte in[], byte out[], size_t blocks) const { int out_len = 0; - EVP_EncryptUpdate(&encrypt, out, &out_len, in, blocks * BLOCK_SIZE); + EVP_EncryptUpdate(&encrypt, out, &out_len, in, blocks * block_sz); } /* @@ -104,7 +112,7 @@ void EVP_BlockCipher::decrypt_n(const byte in[], byte out[], size_t blocks) const { int out_len = 0; - EVP_DecryptUpdate(&decrypt, out, &out_len, in, blocks * BLOCK_SIZE); + EVP_DecryptUpdate(&decrypt, out, &out_len, in, blocks * block_sz); } /* |