Botan  1.10.9
square.h
Go to the documentation of this file.
1 /*
2 * Square
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_SQUARE_H__
9 #define BOTAN_SQUARE_H__
10 
11 #include <botan/block_cipher.h>
12 
13 namespace Botan {
14 
15 /**
16 * Square
17 */
18 class BOTAN_DLL Square : public Block_Cipher_Fixed_Params<16, 16>
19  {
20  public:
21  void encrypt_n(const byte in[], byte out[], size_t blocks) const;
22  void decrypt_n(const byte in[], byte out[], size_t blocks) const;
23 
24  void clear();
25  std::string name() const { return "Square"; }
26  BlockCipher* clone() const { return new Square; }
27 
28  Square() : EK(28), DK(28), ME(32), MD(32) {}
29  private:
30  void key_schedule(const byte[], size_t);
31 
32  static void transform(u32bit[4]);
33 
34  static const byte SE[256];
35  static const byte SD[256];
36  static const byte Log[256];
37  static const byte ALog[255];
38 
39  static const u32bit TE0[256];
40  static const u32bit TE1[256];
41  static const u32bit TE2[256];
42  static const u32bit TE3[256];
43  static const u32bit TD0[256];
44  static const u32bit TD1[256];
45  static const u32bit TD2[256];
46  static const u32bit TD3[256];
47 
48  SecureVector<u32bit> EK, DK;
49  SecureVector<byte> ME, MD;
50  };
51 
52 }
53 
54 #endif
#define transform(B0, B1, B2, B3)
Definition: serp_simd.cpp:441
std::string name() const
Definition: square.h:25
unsigned char byte
Definition: types.h:22
BlockCipher * clone() const
Definition: square.h:26
unsigned int u32bit
Definition: types.h:32