Fabcoin Core  0.16.2
P2P Digital Currency
wake.h
Go to the documentation of this file.
1 // wake.h - written and placed in the public domain by Wei Dai
2 
5 
6 #ifndef CRYPTOPP_WAKE_H
7 #define CRYPTOPP_WAKE_H
8 
9 #include "seckey.h"
10 #include "secblock.h"
11 #include "strciphr.h"
12 
14 
15 template <class B = BigEndian>
20 struct WAKE_OFB_Info : public FixedKeyLength<32>
21 {
22  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "WAKE-OFB-LE" : "WAKE-OFB-BE";}
23 };
24 
26 {
27 protected:
28  word32 M(word32 x, word32 y);
29  void GenKey(word32 k0, word32 k1, word32 k2, word32 k3);
30 
31  word32 t[257];
32  word32 r3, r4, r5, r6;
33 };
34 
39 template <class B = BigEndian>
40 class CRYPTOPP_NO_VTABLE WAKE_Policy : public AdditiveCipherConcretePolicy<word32, 1, 64>, protected WAKE_Base
41 {
42 protected:
43  void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
44  // OFB
45  void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
46  bool CipherIsRandomAccess() const {return false;}
47 };
48 
53 template <class B = BigEndian>
55 {
57  typedef Encryption Decryption;
58 };
59 
60 /*
61 template <class B = BigEndian>
62 class WAKE_ROFB_Policy : public WAKE_Policy<B>
63 {
64 protected:
65  void Iterate(KeystreamOperation operation, byte *output, const byte *input, unsigned int iterationCount);
66 };
67 
68 template <class B = BigEndian>
69 struct WAKE_ROFB : public WAKE_Info<B>
70 {
71  typedef SymmetricCipherTemplate<ConcretePolicyHolder<AdditiveCipherTemplate<>, WAKE_ROFB_Policy<B> > > Encryption;
72  typedef Encryption Decryption;
73 };
74 */
75 
77 
78 #endif
Inherited by keyed algorithms with fixed key length.
Definition: seckey.h:127
uint8_t byte
Definition: Common.h:57
#define k3
Definition: ripemd.cpp:21
#define CRYPTOPP_STATIC_CONSTEXPR
Definition: config.h:892
Base class for additive stream ciphers.
Definition: strciphr.h:186
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
Converts an enumeration to a type suitable for use as a template parameter.
Definition: cryptlib.h:116
bool CipherIsRandomAccess() const
Flag indicating random access.
Definition: wake.h:46
WAKE stream cipher.
Definition: wake.h:54
byte order is little-endian
Definition: cryptlib.h:126
Classes and functions for secure memory allocations.
#define x(i)
Definition: wake.h:25
Classes and functions for implementing secret key algorithms.
virtual void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount)=0
Operates the keystream.
#define k0
Definition: ripemd.cpp:18
word32 r6
Definition: wake.h:32
WAKE stream cipher operation.
Definition: wake.h:40
#define CRYPTOPP_NO_VTABLE
Definition: config.h:369
Classes for implementing stream ciphers.
Provides Encryption and Decryption typedefs used by derived classes to implement a symmetric cipher...
Definition: seckey.h:424
WAKE stream cipher information.
Definition: wake.h:20
Encryption Decryption
Definition: wake.h:57
#define k2
Definition: ripemd.cpp:20
#define k1
Definition: ripemd.cpp:19
#define NAMESPACE_END
Definition: config.h:201
KeystreamOperation
Keystream operation flags.
Definition: strciphr.h:90
CRYPTOPP_STATIC_CONSTEXPR const char * StaticAlgorithmName()
Definition: wake.h:22
SymmetricCipher implementation.
Definition: strciphr.h:584
SymmetricCipherFinal< ConcretePolicyHolder< WAKE_Policy< B >, AdditiveCipherTemplate<> >, WAKE_OFB_Info< B > > Encryption
Definition: wake.h:56
unsigned int word32
Definition: config.h:231
Base class for additive stream ciphers with SymmetricCipher interface.
Definition: strciphr.h:267
Interface for retrieving values given their names.
Definition: cryptlib.h:279