/*************************************************
* Engine Header File                             *
* (C) 1999-2004 The Botan Project                *
*************************************************/

#ifndef BOTAN_ENGINE_H__
#define BOTAN_ENGINE_H__

#include <botan/base.h>
#include <botan/pk_ops.h>
#include <botan/reducer.h>

namespace Botan {

/*************************************************
* Engine Base Class                              *
*************************************************/
class Engine
   {
   public:
      virtual IF_Operation* if_op(const BigInt&, const BigInt&, const BigInt&,
                                  const BigInt&, const BigInt&, const BigInt&,
                                  const BigInt&, const BigInt&) const;

      virtual DSA_Operation* dsa_op(const DL_Group&, const BigInt&,
                                    const BigInt&) const;
      virtual NR_Operation* nr_op(const DL_Group&, const BigInt&,
                                  const BigInt&) const;

      virtual ELG_Operation* elg_op(const DL_Group&, const BigInt&,
                                    const BigInt&) const;

      virtual DH_Operation* dh_op(const DL_Group&, const BigInt&) const;

      virtual ModularReducer* reducer(const BigInt&, bool) const;

      virtual ~Engine() {}
   };

namespace Engine_Core {

/*************************************************
* Engine Management                              *
*************************************************/
void add_engine(Engine*);

/*************************************************
* Get an operation from an Engine                *
*************************************************/
IF_Operation* if_op(const BigInt&, const BigInt&, const BigInt&,
                    const BigInt&, const BigInt&, const BigInt&,
                    const BigInt&, const BigInt&);

DSA_Operation* dsa_op(const DL_Group&, const BigInt&, const BigInt&);
NR_Operation* nr_op(const DL_Group&, const BigInt&, const BigInt&);

ELG_Operation* elg_op(const DL_Group&, const BigInt&, const BigInt&);

DH_Operation* dh_op(const DL_Group&, const BigInt&);

}

}

#endif
