#ifndef RSAES_H_INCLUDED
#define RSAES_H_INCLUDED

#include <crypto/ac.h>
#include <crypto/rem.h>


class RSAES : public AC
{
	NTL::ZZ n, e, d;
	REM& rem;
	ostring rsatransform(const ostring& X, NTL::ZZ& a);
 public:
	ostring encrypt(const ostring& L, const ostring& M);
	ostring decrypt(const ostring& L, const ostring& C);
	void writetofile(std::ostream& ofile);

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

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

	RSAES(REM& r, int Primelen = 512);
	RSAES(REM& r, std::istream& ifile);
};

#endif /* RSAES_H_INCLUDED */

