summaryrefslogtreecommitdiff
path: root/src/experimental/cipher.h
blob: 2327aa6c9c114a96db640732126ec6cb61db5d2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef BU_CIPHER_H
#define BU_CIPHER_H

#include "bu/filter.h"

namespace Bu
{
	class Cipher : Bu::Filter
	{
	public:
		Cipher( Bu::Stream &rNext );
		virtual ~Cipher();

		virtual void start();
		virtual Bu::size stop();

		virtual Bu::size read( void *pBuf, Bu::size iBytes );
		virtual Bu::size write( const void *pBuf, Bu::size iBytes );

		using Bu::Stream::read;
		using Bu::Stream::write;

	protected:
		virtual void encipher( void *pData )=0;
		virtual void decipher( void *pData )=0;
	};
};

#endif