File indexing completed on 2025-01-18 09:55:09
0001
0002
0003
0004
0005
0006
0007 #ifndef CRYPTOPP_SHACAL2_H
0008 #define CRYPTOPP_SHACAL2_H
0009
0010 #include "seckey.h"
0011 #include "secblock.h"
0012
0013 NAMESPACE_BEGIN(CryptoPP)
0014
0015
0016 struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64>
0017 {
0018 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SHACAL-2";}
0019 };
0020
0021
0022
0023
0024 class SHACAL2 : public SHACAL2_Info, public BlockCipherDocumentation
0025 {
0026
0027
0028 class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SHACAL2_Info>
0029 {
0030 public:
0031 std::string AlgorithmProvider() const;
0032 void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms);
0033
0034 protected:
0035 FixedSizeAlignedSecBlock<word32, 64> m_key;
0036
0037 static const word32 K[64];
0038 };
0039
0040
0041
0042 class CRYPTOPP_NO_VTABLE Enc : public Base
0043 {
0044 public:
0045 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
0046 };
0047
0048
0049
0050 class CRYPTOPP_NO_VTABLE Dec : public Base
0051 {
0052 public:
0053 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
0054 };
0055
0056 public:
0057 typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
0058 typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
0059 };
0060
0061 typedef SHACAL2::Encryption SHACAL2Encryption;
0062 typedef SHACAL2::Decryption SHACAL2Decryption;
0063
0064 NAMESPACE_END
0065
0066 #endif