00001
00002
00003
00004
00005
00006 #ifndef CRYPTOPP_WAKE_H
00007 #define CRYPTOPP_WAKE_H
00008
00009 #include "seckey.h"
00010 #include "secblock.h"
00011 #include "strciphr.h"
00012
00013 NAMESPACE_BEGIN(CryptoPP)
00014
00015
00016 template <class B = BigEndian>
00017 struct WAKE_OFB_Info : public FixedKeyLength<32>
00018 {
00019 static const char *StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "WAKE-OFB-LE" : "WAKE-OFB-BE";}
00020 };
00021
00022 class CRYPTOPP_NO_VTABLE WAKE_Base
00023 {
00024 protected:
00025 word32 M(word32 x, word32 y);
00026 void GenKey(word32 k0, word32 k1, word32 k2, word32 k3);
00027
00028 word32 t[257];
00029 word32 r3, r4, r5, r6;
00030 };
00031
00032 template <class B = BigEndian>
00033 class CRYPTOPP_NO_VTABLE WAKE_Policy : public AdditiveCipherConcretePolicy<word32, 1, 64>, protected WAKE_Base
00034 {
00035 protected:
00036 void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length);
00037
00038 void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
00039 bool CipherIsRandomAccess() const {return false;}
00040 };
00041
00042
00043 template <class B = BigEndian>
00044 struct WAKE_OFB : public WAKE_OFB_Info<B>, public SymmetricCipherDocumentation
00045 {
00046 typedef SymmetricCipherFinal<ConcretePolicyHolder<WAKE_Policy<B>, AdditiveCipherTemplate<> >, WAKE_OFB_Info<B> > Encryption;
00047 typedef Encryption Decryption;
00048 };
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 NAMESPACE_END
00067
00068 #endif