#ifndef INCLUDED_DECRYPTBUF_
#define INCLUDED_DECRYPTBUF_

#include <openssl/evp.h>

#include <iosfwd>
#include <bobcat/exception>
#include <bobcat/eoibuf>

//class EVP_CIPHER_CTX;

namespace FBB
{

class DecryptBuf: public EoiBuf
{
    public:
        DecryptBuf(std::ostream &outStream, char const *type,
                   std::string const &key, std::string const &iv,
                   size_t bufSize = 1024);
        ~DecryptBuf() override;

        bool setRounds(size_t nRounds);
        void eoi();                                 // .f

    protected:
        EVP_CIPHER_CTX *cipherCtx();
};

inline void DecryptBuf::eoi()
{}

}   // FBB

#endif
