Crypto++
idea.h
Go to the documentation of this file.
1 #ifndef CRYPTOPP_IDEA_H
2 #define CRYPTOPP_IDEA_H
3 
4 /** \file
5 */
6 
7 #include "seckey.h"
8 #include "secblock.h"
9 
10 NAMESPACE_BEGIN(CryptoPP)
11 
12 //! _
13 struct IDEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public FixedRounds<8>
14 {
15  static const char *StaticAlgorithmName() {return "IDEA";}
16 };
17 
18 /// <a href="http://www.weidai.com/scan-mirror/cs.html#IDEA">IDEA</a>
19 class IDEA : public IDEA_Info, public BlockCipherDocumentation
20 {
21 public: // made public for internal purposes
22 #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE
23  typedef word Word;
24 #else
25  typedef hword Word;
26 #endif
27 
28 private:
29  class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<IDEA_Info>
30  {
31  public:
32  unsigned int OptimalDataAlignment() const {return 2;}
33  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
34 
35  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
36 
37  private:
38  void EnKey(const byte *);
39  void DeKey();
41 
42  #ifdef IDEA_LARGECACHE
43  static inline void LookupMUL(word &a, word b);
44  void LookupKeyLogs();
45  static void BuildLogTables();
46  static volatile bool tablesBuilt;
47  static word16 log[0x10000], antilog[0x10000];
48  #endif
49  };
50 
51 public:
54 };
55 
58 
59 NAMESPACE_END
60 
61 #endif
IDEA
Definition: idea.h:19
to be inherited by keyed algorithms with fixed key length
Definition: seckey.h:66
These objects usually should not be used directly. See CipherModeDocumentation instead.
Definition: seckey.h:188
to be inherited by block ciphers with fixed block size
Definition: seckey.h:21
to be inherited by ciphers with fixed number of rounds
Definition: seckey.h:31
_
Definition: idea.h:13
interface for retrieving values given their names
Definition: cryptlib.h:224