Crypto++  5.6.3
Free C++ class library of cryptographic schemes
shacal2.h
Go to the documentation of this file.
1 // shacal.h - written and placed in the public domain by Wei Dai
2 
3 //! \file shacal2.h
4 //! \brief Classes for the SHACAL-2 block cipher
5 
6 #ifndef CRYPTOPP_SHACAL2_H
7 #define CRYPTOPP_SHACAL2_H
8 
9 #include "seckey.h"
10 #include "secblock.h"
11 
12 NAMESPACE_BEGIN(CryptoPP)
13 
14 //! \class SHACAL2_Info
15 //! \brief SHACAL2 block cipher information
16 struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64>
17 {
18  static const char *StaticAlgorithmName() {return "SHACAL-2";}
19 };
20 
21 //! \class SHACAL2
22 //! \brief SHACAL2 block cipher
23 //! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#SHACAL-2">SHACAL-2</a>
25 {
26  class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SHACAL2_Info>
27  {
28  public:
29  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
30 
31  protected:
33 
34  static const word32 K[64];
35  };
36 
37  class CRYPTOPP_NO_VTABLE Enc : public Base
38  {
39  public:
40  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
41  };
42 
43  class CRYPTOPP_NO_VTABLE Dec : public Base
44  {
45  public:
46  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
47  };
48 
49 public:
52 };
53 
56 
57 NAMESPACE_END
58 
59 #endif
SHACAL2 block cipher.
Definition: shacal2.h:24
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:396
Interface for one direction (encryption or decryption) of a block cipher.
Definition: cryptlib.h:1091
Classes and functions for secure memory allocations.
Inherited by algorithms with fixed block size.
Definition: seckey.h:34
Classes and functions for implementing secret key algorithms.
SHACAL2 block cipher information.
Definition: shacal2.h:16
Inherited by keyed algorithms with variable key length.
Definition: seckey.h:157
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Definition: seckey.h:303
Crypto++ library namespace.
Interface for retrieving values given their names.
Definition: cryptlib.h:277