#ifndef REM_H_INCLUDED
#define REM_H_INCLUDED

#include <crypto/crypto.h>
#include <crypto/hash.h>
#include <crypto/kdf.h>


class REM
{
 public:
	const int Bound;
	virtual ostring encode(const ostring& M, const ostring& L, int outlen) = 0;
	virtual ostring decode(const ostring& E, const ostring& L) = 0;

	virtual void PrettyPrint(std::ostream&) = 0;

	std::ostream *logfile; //only used to log encryption

	REM(int b) : Bound(b) { logfile = NULL; };
};


class REM1 : public REM
{
	const int Hlen;
	HASH& h;
	KDF& k;
 public:
	ostring encode(const ostring& M, const ostring& L, int outlen);
	ostring decode(const ostring& E, const ostring& L);

        void PrettyPrint(std::ostream&); //called to print parameters

	REM1(HASH& H, KDF& K) : h(H), k(K), Hlen(H.outlen),
					REM(2 * H.outlen + 2) { };
};

#endif  /* REM_H_INCLUDED */

