blob: ef2897fae1c383511e2e3ad19f7a021b3b9c8b52 (
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 Header File *
* (C) 1999-2007 Jack Lloyd *
*************************************************/
#ifndef BOTAN_GOST_H__
#define BOTAN_GOST_H__
#include <botan/block_cipher.h>
namespace Botan {
/*************************************************
* GOST *
*************************************************/
class BOTAN_DLL GOST : public BlockCipher
{
public:
void clear() throw() { EK.clear(); }
std::string name() const { return "GOST"; }
BlockCipher* clone() const { return new GOST; }
GOST() : BlockCipher(8, 32) {}
private:
void enc(const byte[], byte[]) const;
void dec(const byte[], byte[]) const;
void key(const byte[], u32bit);
static const u32bit SBOX1[256];
static const u32bit SBOX2[256];
static const u32bit SBOX3[256];
static const u32bit SBOX4[256];
SecureBuffer<u32bit, 32> EK;
};
}
#endif
|