/*
   +----------------------------------------------------------------------+
   | 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: jstream_t.h,v 1.6 2005/01/06 18:16:43 jay Exp $
*/

#ifndef __JSTREAM_T_H__
#define __JSTREAM_T_H__

#include "jbasiccipherinfo.h"

template <typename INFO, enum Cipher TYPE>
class JStream_Template : public JBasicCipherInfo<INFO, JStream>
{
	public:
		JStream_Template();

		inline enum Cipher getCipherType() const;
		inline unsigned int getBlockSize() const { return 0; }

		bool encrypt();
		bool decrypt();

		bool encryptPHPStream(php_stream* in, php_stream* out);
		bool decryptPHPStream(php_stream* in, php_stream* out);

		/* These are deprecated. They were used before using php_streams. Use them
		   if you're using this code in something other than the cryptopp PHP
		   extension...
		bool encryptFile(const string in, const string out);
		bool decryptFile(const string in, const string out); */

	protected:
		virtual SymmetricCipher* getEncryptionObject() = 0;
		virtual SymmetricCipher* getDecryptionObject() = 0;
};

#include "jstream_t.cpp"

#endif
