Fabcoin Core  0.16.2
P2P Digital Currency
shark.h
Go to the documentation of this file.
1 // shark.h - written and placed in the public domain by Wei Dai
2 
5 
6 #ifndef CRYPTOPP_SHARK_H
7 #define CRYPTOPP_SHARK_H
8 
9 #include "config.h"
10 #include "seckey.h"
11 #include "secblock.h"
12 
14 
15 struct SHARK_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<6, 2>
18 {
19  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SHARK-E";}
20 };
21 
26 {
29  class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SHARK_Info>
30  {
31  public:
32  void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &param);
33 
34  protected:
35  unsigned int m_rounds;
37  };
38 
41  class CRYPTOPP_NO_VTABLE Enc : public Base
42  {
43  public:
44  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
45 
46  // used by Base to do key setup
47  void InitForKeySetup();
48 
49  private:
50  static const byte sbox[256];
51  static const word64 cbox[8][256];
52  };
53 
56  class CRYPTOPP_NO_VTABLE Dec : public Base
57  {
58  public:
59  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
60 
61  private:
62  static const byte sbox[256];
63  static const word64 cbox[8][256];
64  };
65 
66 public:
69 };
70 
73 
75 
76 #endif
Inherited by keyed algorithms with fixed key length.
Definition: seckey.h:127
uint8_t byte
Definition: Common.h:57
#define CRYPTOPP_STATIC_CONSTEXPR
Definition: config.h:892
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:408
unsigned int m_rounds
Definition: shark.h:35
SHARK::Encryption SHARKEncryption
Definition: shark.h:71
SHARK block cipher SHARK-E
Definition: shark.h:25
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
CRYPTOPP_STATIC_CONSTEXPR const char * StaticAlgorithmName()
Definition: shark.h:19
SHARK block cipher encryption operation.
Definition: shark.h:41
Library configuration file.
BlockCipherFinal< DECRYPTION, Dec > Decryption
Definition: shark.h:68
SecBlock< word64 > m_roundKeys
Definition: shark.h:36
Classes and functions for secure memory allocations.
Inherited by algorithms with fixed block size.
Definition: seckey.h:40
BlockCipherFinal< ENCRYPTION, Enc > Encryption
Definition: shark.h:67
Inherited by algorithms with variable number of rounds.
Definition: seckey.h:66
Classes and functions for implementing secret key algorithms.
SHARK block cipher information.
Definition: shark.h:17
unsigned long long word64
Definition: config.h:240
#define CRYPTOPP_NO_VTABLE
Definition: config.h:369
#define NAMESPACE_END
Definition: config.h:201
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Definition: seckey.h:311
SHARK block cipher decryption operation.
Definition: shark.h:56
SHARK::Decryption SHARKDecryption
Definition: shark.h:72
SHARK block cipher default operation.
Definition: shark.h:29
Interface for retrieving values given their names.
Definition: cryptlib.h:279