00001
00002
00003
00004
00005
00006 #ifndef CRYPTOPP_THREEWAY_H
00007 #define CRYPTOPP_THREEWAY_H
00008
00009 #include "config.h"
00010 #include "seckey.h"
00011 #include "secblock.h"
00012
00013 NAMESPACE_BEGIN(CryptoPP)
00014
00015
00016
00017 struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11>
00018 {
00019 static const char *StaticAlgorithmName() {return "3-Way";}
00020 };
00021
00022
00023
00024
00025
00026 class ThreeWay : public ThreeWay_Info, public BlockCipherDocumentation
00027 {
00028
00029
00030
00031 class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<ThreeWay_Info>
00032 {
00033 public:
00034 void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms);
00035
00036 protected:
00037 unsigned int m_rounds;
00038 FixedSizeSecBlock<word32, 3> m_k;
00039 };
00040
00041
00042
00043
00044 class CRYPTOPP_NO_VTABLE Enc : public Base
00045 {
00046 public:
00047 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
00048 };
00049
00050
00051
00052
00053 class CRYPTOPP_NO_VTABLE Dec : public Base
00054 {
00055 public:
00056 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
00057 };
00058
00059 public:
00060 typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
00061 typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
00062 };
00063
00064 typedef ThreeWay::Encryption ThreeWayEncryption;
00065 typedef ThreeWay::Decryption ThreeWayDecryption;
00066
00067 NAMESPACE_END
00068
00069 #endif