/*
   +----------------------------------------------------------------------+
   | Copyright (c) 2002-2005 J Smith <dark_panda@hushmail.com>            |
   | Crypto++ sources (not included) copyright (c) 1995-2003 Wei Dai      |
   +----------------------------------------------------------------------+
   | Check out COPYING for the exact license.                             |
   +----------------------------------------------------------------------+

$Id: jcipher.h,v 1.6 2005/01/06 18:16:42 jay Exp $
*/

#ifndef __JCIPHER_H__
#define __JCIPHER_H__

#include "jbase.h"

// Crypto++ headers...

#include "modes.h"

class JCipher : public JBase
{
	public:
		JCipher();

		string getModeName() const;
		static string getModeName(const enum Mode mode);
		enum Mode getMode() const;
		void setMode(const enum Mode mode);

		string getPaddingName() const;
		static string getPaddingName(const enum Padding padding);
		enum Padding getPadding() const;
		enum Padding setPadding(const enum Padding padding);

		string getRNGName() const;
		static string getRNGName(const enum RNG rng);
		enum RNG getRNG() const;
		enum RNG setRNG(const enum RNG rng);

		unsigned int getRounds() const;
		unsigned int setRounds(const unsigned int rounds);
		virtual unsigned int getValidRounds(const unsigned int rounds) const = 0;

		string getIV(bool hex = false) const;
		void setIV(string iv, bool hex = false);
		void setRandIV(const unsigned int size);

	protected:
		enum Mode itsMode;
		enum Padding itsPadding;
		enum RNG itsRNG;
		unsigned int itsRounds;
		string itsIV;
};

#define getIVHex() getIV(true)
#define getIVBin() getIV()

#endif
