Crypto++ 8.9
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
13NAMESPACE_BEGIN(CryptoPP)
14
15/// \brief SHACAL2 block cipher information
16struct 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 std::string AlgorithmProvider() const;
32 void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
33
34 protected:
36
37 static const word32 K[64];
38 };
39
40 /// \brief SHACAL2 block cipher transformation functions
41 /// \details Encryption transformation
42 class CRYPTOPP_NO_VTABLE Enc : public Base
43 {
44 public:
45 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
46 };
47
48 /// \brief SHACAL2 block cipher transformation functions
49 /// \details Decryption transformation
50 class CRYPTOPP_NO_VTABLE Dec : public Base
51 {
52 public:
53 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
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
Fixed size stack-based SecBlock with 16-byte alignment.
Definition secblock.h:1259
Interface for retrieving values given their names.
Definition cryptlib.h:327
SHACAL2 block cipher.
Definition shacal2.h:25
Inherited by keyed algorithms with variable key length.
Definition seckey.h:166
unsigned int word32
32-bit unsigned datatype
Definition config_int.h:72
Crypto++ library namespace.
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
SHACAL2 block cipher information.
Definition shacal2.h:17