aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/gost_28147/gost_28147.h
blob: 1ff04b8900311e454b976ad231c523018fe08e65 (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
36
37
38
/*
* GOST 28147-89
* (C) 1999-2009 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/

#ifndef BOTAN_GOST_28147_89_H__
#define BOTAN_GOST_28147_89_H__

#include <botan/block_cipher.h>

namespace Botan {

/**
* GOST 28147-89
*/
class BOTAN_DLL GOST_28147_89 : public BlockCipher
   {
   public:
      void clear() throw() { EK.clear(); }

      std::string name() const { return "GOST-28147-89"; }
      BlockCipher* clone() const { return new GOST_28147_89; }

      GOST_28147_89();
   private:
      void enc(const byte[], byte[]) const;
      void dec(const byte[], byte[]) const;
      void key_schedule(const byte[], u32bit);

      SecureBuffer<u32bit, 1024> SBOX;
      SecureBuffer<u32bit, 8> EK;
   };

}

#endif