File indexing completed on 2025-01-18 09:54:53
0001
0002
0003
0004
0005
0006 #ifndef CRYPTOPP_THREEWAY_H
0007 #define CRYPTOPP_THREEWAY_H
0008
0009 #include "config.h"
0010 #include "seckey.h"
0011 #include "secblock.h"
0012
0013 NAMESPACE_BEGIN(CryptoPP)
0014
0015
0016 struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11>
0017 {
0018 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "3-Way";}
0019 };
0020
0021
0022
0023 class ThreeWay : public ThreeWay_Info, public BlockCipherDocumentation
0024 {
0025
0026
0027 class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<ThreeWay_Info>
0028 {
0029 public:
0030 void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms);
0031
0032 protected:
0033 unsigned int m_rounds;
0034 FixedSizeSecBlock<word32, 3> m_k;
0035 };
0036
0037
0038
0039 class CRYPTOPP_NO_VTABLE Enc : public Base
0040 {
0041 public:
0042 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
0043 };
0044
0045
0046
0047 class CRYPTOPP_NO_VTABLE Dec : public Base
0048 {
0049 public:
0050 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
0051 };
0052
0053 public:
0054 typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
0055 typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
0056 };
0057
0058 typedef ThreeWay::Encryption ThreeWayEncryption;
0059 typedef ThreeWay::Decryption ThreeWayDecryption;
0060
0061 NAMESPACE_END
0062
0063 #endif