diff options
author | lloyd <[email protected]> | 2010-10-13 01:34:15 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 01:34:15 +0000 |
commit | fe4119c74b5e81a354a5313e4d2efbf9a135aa81 (patch) | |
tree | 5c5254cc3a4e5713169ef1d52a83db19c8c4ed65 /src/engine | |
parent | 60fb91d8cb1710d07041f76050d24229ce91131b (diff) |
Use size_t rather than u32bit in SymmetricAlgorithm
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/openssl/ossl_arc4.cpp | 14 | ||||
-rw-r--r-- | src/engine/openssl/ossl_bc.cpp | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/engine/openssl/ossl_arc4.cpp b/src/engine/openssl/ossl_arc4.cpp index 78217a760..1273d239d 100644 --- a/src/engine/openssl/ossl_arc4.cpp +++ b/src/engine/openssl/ossl_arc4.cpp @@ -23,13 +23,13 @@ class ARC4_OpenSSL : public StreamCipher std::string name() const; StreamCipher* clone() const { return new ARC4_OpenSSL(SKIP); } - ARC4_OpenSSL(u32bit s = 0) : StreamCipher(1, 32), SKIP(s) { clear(); } + ARC4_OpenSSL(size_t s = 0) : StreamCipher(1, 32), SKIP(s) { clear(); } ~ARC4_OpenSSL() { clear(); } private: - void cipher(const byte[], byte[], u32bit); - void key_schedule(const byte[], u32bit); + void cipher(const byte[], byte[], size_t); + void key_schedule(const byte[], size_t); - const u32bit SKIP; + const size_t SKIP; RC4_KEY state; }; @@ -46,18 +46,18 @@ std::string ARC4_OpenSSL::name() const /* * ARC4 Key Schedule */ -void ARC4_OpenSSL::key_schedule(const byte key[], u32bit length) +void ARC4_OpenSSL::key_schedule(const byte key[], size_t length) { RC4_set_key(&state, length, key); byte dummy = 0; - for(u32bit j = 0; j != SKIP; j++) + for(size_t i = 0; i != SKIP; ++i) RC4(&state, 1, &dummy, &dummy); } /* * ARC4 Encryption */ -void ARC4_OpenSSL::cipher(const byte in[], byte out[], u32bit length) +void ARC4_OpenSSL::cipher(const byte in[], byte out[], size_t length) { RC4(&state, length, in, out); } diff --git a/src/engine/openssl/ossl_bc.cpp b/src/engine/openssl/ossl_bc.cpp index 9dc1159a0..891927b9f 100644 --- a/src/engine/openssl/ossl_bc.cpp +++ b/src/engine/openssl/ossl_bc.cpp @@ -29,7 +29,7 @@ class EVP_BlockCipher : public BlockCipher private: 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[], u32bit); + void key_schedule(const byte[], size_t); std::string cipher_name; mutable EVP_CIPHER_CTX encrypt, decrypt; }; @@ -110,7 +110,7 @@ void EVP_BlockCipher::decrypt_n(const byte in[], byte out[], /* * Set the key */ -void EVP_BlockCipher::key_schedule(const byte key[], u32bit length) +void EVP_BlockCipher::key_schedule(const byte key[], size_t length) { SecureVector<byte> full_key(key, length); @@ -211,14 +211,14 @@ OpenSSL_Engine::find_block_cipher(const SCAN_Name& request, HANDLE_EVP_CIPHER_KEYLEN("RC2", EVP_rc2_ecb(), 1, 32, 1); #endif -#if !defined(OPENSSL_NO_RC5) +#if !defined(OPENSSL_NO_RC5) && 0 if(request.algo_name() == "RC5") if(request.arg_as_integer(0, 12) == 12) return new EVP_BlockCipher(EVP_rc5_32_12_16_ecb(), "RC5(12)", 1, 32, 1); #endif -#if !defined(OPENSSL_NO_IDEA) +#if !defined(OPENSSL_NO_IDEA) && 0 HANDLE_EVP_CIPHER("IDEA", EVP_idea_ecb()); #endif |