Botan  1.10.9
desx.h
Go to the documentation of this file.
1 /*
2 * DESX
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_DESX_H__
9 #define BOTAN_DESX_H__
10 
11 #include <botan/des.h>
12 
13 namespace Botan {
14 
15 /**
16 * DESX
17 */
18 class BOTAN_DLL DESX : public Block_Cipher_Fixed_Params<8, 24>
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() { des.clear(); zeroise(K1); zeroise(K2); }
25  std::string name() const { return "DESX"; }
26  BlockCipher* clone() const { return new DESX; }
27 
28  DESX() : K1(8), K2(8) {}
29  private:
30  void key_schedule(const byte[], size_t);
31  SecureVector<byte> K1, K2;
32  DES des;
33  };
34 
35 }
36 
37 #endif
std::string name() const
Definition: desx.h:25
DESX()
Definition: desx.h:28
unsigned char byte
Definition: types.h:22
void clear()
Definition: desx.h:24
Definition: des.h:18
BlockCipher * clone() const
Definition: desx.h:26
void zeroise(MemoryRegion< T > &vec)
Definition: secmem.h:415