Security Scol plugin
idea.h
Go to the documentation of this file.
1// idea.h - originally written and placed in the public domain by Wei Dai
2
5
6#ifndef CRYPTOPP_IDEA_H
7#define CRYPTOPP_IDEA_H
8
9#include "seckey.h"
10#include "secblock.h"
11
12NAMESPACE_BEGIN(CryptoPP)
13
14
16struct IDEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public FixedRounds<8>
17{
18 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "IDEA";}
19};
20
25{
26public: // made public for internal purposes
27#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE
28 typedef word Word;
29#else
30 typedef hword Word;
31#endif
32
33private:
34 class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<IDEA_Info>
35 {
36 public:
37 unsigned int OptimalDataAlignment() const {return 2;}
38 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
39
40 void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
41
42 private:
43 void EnKey(const byte *);
44 void DeKey();
46
47 #ifdef IDEA_LARGECACHE
48 static inline void LookupMUL(word &a, word b);
49 void LookupKeyLogs();
50 static void BuildLogTables();
51 static volatile bool tablesBuilt;
52 static word16 log[0x10000], antilog[0x10000];
53 #endif
54 };
55
56public:
59};
60
63
64NAMESPACE_END
65
66#endif
Provides class member functions to key a block cipher.
Definition seckey.h:318
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Definition seckey.h:306
Inherited by algorithms with fixed block size.
Definition seckey.h:41
Inherited by keyed algorithms with fixed key length.
Definition seckey.h:125
Inherited by algorithms with fixed number of rounds.
Definition seckey.h:53
Fixed size stack-based SecBlock.
Definition secblock.h:1246
IDEA block cipher.
Definition idea.h:25
Interface for retrieving values given their names.
Definition cryptlib.h:322
unsigned short word16
16-bit unsigned datatype
Definition config_int.h:59
Classes and functions for secure memory allocations.
Classes and functions for implementing secret key algorithms.
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher.
Definition seckey.h:399
IDEA block cipher information.
Definition idea.h:17