#include "bigint"

#include <cstring>
#include <cctype>
#include <algorithm>

#include <openssl/ui.h>
#include "../exception/exception"
#include "../fswap/fswap"

#if  OPENSSL_VERSION_NUMBER < 0x10100000L
inline BIGNUM *BN_generate_prime_ex(BIGNUM *ret, int num, int safe, 
            BIGNUM *add, BIGNUM *rem, 
            void (*callbackNotUsed)(int, int, void *))
{
    return BN_generate_prime(ret, num, safe, add, rem, callbackNotUsed, 0);
}
#endif

namespace FBB
{

class BNCTX
{
    BN_CTX *d_ctx;

    public:
        BNCTX();                                    // .f
        ~BNCTX();                                   // destructor.f
        void verify();

        operator BN_CTX *();                        // opbnctxptr.f

    private:
        BNCTX(BNCTX const &other) = delete;
        BNCTX &operator=(BNCTX const &other) = delete;
};

#include "bnctx.f"
#include "destructor.f"
#include "opbnctxptr.f"

} // namespace FBB
        
using namespace std;
using namespace FBB;
