diff --git a/crypto-openssl.cpp b/crypto-openssl.cpp index 48d7af5..cb168fc 100644 --- a/crypto-openssl.cpp +++ b/crypto-openssl.cpp @@ -43,7 +43,7 @@ void init_crypto () ERR_load_crypto_strings(); } -struct Aes_impl { +struct Aes_ecb_encryptor::Aes_impl { AES_KEY key; }; @@ -66,7 +66,7 @@ void Aes_ecb_encryptor::encrypt(const unsigned char* plain, unsigned char* ciphe AES_encrypt(plain, cipher, &(impl->key)); } -struct Hmac_impl { +struct Hmac_sha1_state::Hmac_impl { HMAC_CTX ctx; }; diff --git a/crypto.hpp b/crypto.hpp index 4eedc07..adc9643 100644 --- a/crypto.hpp +++ b/crypto.hpp @@ -47,8 +47,6 @@ struct Crypto_error { Crypto_error (const std::string& w, const std::string& m) : where(w), message(m) { } }; -struct Aes_impl; - class Aes_ecb_encryptor { public: enum { @@ -57,6 +55,8 @@ public: }; private: + struct Aes_impl; + std::auto_ptr impl; public: @@ -91,8 +91,6 @@ public: typedef Aes_ctr_encryptor Aes_ctr_decryptor; -struct Hmac_impl; - class Hmac_sha1_state { public: enum { @@ -101,6 +99,8 @@ public: }; private: + struct Hmac_impl; + std::auto_ptr impl; public: