Crypto++  6.0
Free C++ class library of cryptographic schemes
shacal2.h
Go to the documentation of this file.
1 // shacal.h - originally 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 /// \since Crypto++ 5.2, Intel SHA since Crypto++ 6.0
6 
7 #ifndef CRYPTOPP_SHACAL2_H
8 #define CRYPTOPP_SHACAL2_H
9 
10 #include "seckey.h"
11 #include "secblock.h"
12 
13 NAMESPACE_BEGIN(CryptoPP)
14 
15 /// \brief SHACAL2 block cipher information
16 struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64>
17 {
18  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SHACAL-2";}
19 };
20 
21 /// \brief SHACAL2 block cipher
22 /// \since Crypto++ 5.2, Intel SHA since Crypto++ 6.0
23 /// \sa <a href="http://www.cryptopp.com/wiki/SHACAL-2">SHACAL-2</a>
25 {
26  /// \brief SHACAL2 block cipher transformation functions
27  /// \details Provides implementation common to encryption and decryption
28  class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SHACAL2_Info>
29  {
30  public:
31  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
32 
33  protected:
35 
36  static const word32 K[64];
37  };
38 
39  /// \brief SHACAL2 block cipher transformation functions
40  /// \details Provides implementation for encryption transformation
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 
47  /// \brief SHACAL2 block cipher transformation functions
48  /// \details Provides implementation for decryption transformation
49  class CRYPTOPP_NO_VTABLE Dec : public Base
50  {
51  public:
52  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
53  };
54 
55 public:
58 };
59 
62 
63 NAMESPACE_END
64 
65 #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:419
Interface for one direction (encryption or decryption) of a block cipher.
Definition: cryptlib.h:1228
Classes and functions for secure memory allocations.
Inherited by algorithms with fixed block size.
Definition: seckey.h:39
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:187
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Definition: seckey.h:326
Crypto++ library namespace.
Interface for retrieving values given their names.
Definition: cryptlib.h:291