Crypto++  5.6.3
Free C++ class library of cryptographic schemes
mars.h
Go to the documentation of this file.
1 // mars.h - written and placed in the public domain by Wei Dai
2 
3 //! \file mars.h
4 //! \brief Classes for the MARS block cipher (IBM AES submission)
5 
6 
7 #ifndef CRYPTOPP_MARS_H
8 #define CRYPTOPP_MARS_H
9 
10 #include "seckey.h"
11 #include "secblock.h"
12 
13 NAMESPACE_BEGIN(CryptoPP)
14 
15 //! _
16 struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 56, 4>
17 {
18  static const char *StaticAlgorithmName() {return "MARS";}
19 };
20 
21 /// <a href="http://www.weidai.com/scan-mirror/cs.html#MARS">MARS</a>
22 class MARS : public MARS_Info, public BlockCipherDocumentation
23 {
24  class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<MARS_Info>
25  {
26  public:
27  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
28 
29  protected:
30  static const word32 Sbox[512];
31 
33  };
34 
35  class CRYPTOPP_NO_VTABLE Enc : public Base
36  {
37  public:
38  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
39  };
40 
41  class CRYPTOPP_NO_VTABLE Dec : public Base
42  {
43  public:
44  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
45  };
46 
47 public:
50 };
51 
54 
55 NAMESPACE_END
56 
57 #endif
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:385
Classes and functions for secure memory allocations.
Inherited by block ciphers with fixed block size.
Definition: seckey.h:34
Classes and functions for implementing secret key algorithms.
_
Definition: mars.h:16
Inherited by keyed algorithms with variable key length.
Definition: seckey.h:152
Provides class member functions to access BlockCipher constants.
Definition: seckey.h:292
Crypto++ library namespace.
MARS
Definition: mars.h:22
Interface for retrieving values given their names.
Definition: cryptlib.h:261