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 
clear()24       void clear() { des.clear(); zeroise(K1); zeroise(K2); }
name()25       std::string name() const { return "DESX"; }
clone()26       BlockCipher* clone() const { return new DESX; }
27 
DESX()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
38