aboutsummaryrefslogtreecommitdiffstats
path: root/include/buf_filt.h
blob: 4cea9108f7ed5ae37b459f1b6b493b77a60a0b52 (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
30
31
32
33
34
35
/*************************************************
* Buffering Filter Header File                   *
* (C) 1999-2006 The Botan Project                *
*************************************************/

#ifndef BOTAN_BUFFERING_FILTER_H__
#define BOTAN_BUFFERING_FILTER_H__

#include <botan/filter.h>

namespace Botan {

/*************************************************
* Buffering Filter                               *
*************************************************/
class Buffering_Filter : public Filter
   {
   public:
      void write(const byte[], u32bit);
      virtual void end_msg();
      Buffering_Filter(u32bit, u32bit = 0);
      virtual ~Buffering_Filter() {}
   protected:
      virtual void initial_block(const byte[]) {}
      virtual void main_block(const byte[]) = 0;
      virtual void final_block(const byte[], u32bit) = 0;
   private:
      const u32bit INITIAL_BLOCK_SIZE, BLOCK_SIZE;
      SecureVector<byte> initial, block;
      u32bit initial_block_pos, block_pos;
   };

}

#endif