#ifndef DEM_H_INCLUDED
#define DEM_H_INCLUDED

#include <crypto/crypto.h>
#include <crypto/sc.h>
#include <crypto/mac.h>


class DEM
{
 public:
	const int keylen;
	virtual ostring encrypt(const ostring& key, const ostring& label, const ostring& mssg) = 0;
	virtual ostring decrypt(const ostring& key, const ostring& label, const ostring& cipher) = 0;

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

	std::ostream *logfile;

	DEM(int len) : keylen(len) { logfile = NULL; };
};


class DEM1 : public DEM
{
	SC& s;
	MAC& m;
 public:
	ostring encrypt(const ostring& key, const ostring& label, const ostring& mssg);
	ostring decrypt(const ostring& key, const ostring& label, const ostring& cipher);

	void PrettyPrint(std::ostream&);

	DEM1(SC& S, MAC& M) : s(S), m(M), DEM(S.keylen + M.keylen) { };
};

#endif /* DEM_H_INCLUDED */

