From 22bae167b0927798df16506b5ab6251d287d46fc Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Mon, 7 Jul 2014 22:29:13 -0700 Subject: [PATCH] Make Aes_impl and Hmac_impl private member classes --- crypto-openssl.cpp | 4 ++-- crypto.hpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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: