Fabcoin Core  0.16.2
P2P Digital Currency
seal.h
Go to the documentation of this file.
1 // seal.h - written and placed in the public domain by Wei Dai
2 
5 
6 #ifndef CRYPTOPP_SEAL_H
7 #define CRYPTOPP_SEAL_H
8 
9 #include "strciphr.h"
10 #include "secblock.h"
11 
13 
14 template <class B = BigEndian>
18 struct SEAL_Info : public FixedKeyLength<20, SimpleKeyingInterface::INTERNALLY_GENERATED_IV, 4>
19 {
20  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "SEAL-3.0-LE" : "SEAL-3.0-BE";}
21 };
22 
26 template <class B = BigEndian>
28 {
29 protected:
30  void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
31  void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
32  void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length);
33  bool CipherIsRandomAccess() const {return true;}
34  void SeekToIteration(lword iterationCount);
35 
36 private:
40 
41  word32 m_startCount, m_iterationsPerCount;
42  word32 m_outsideCounter, m_insideCounter;
43 };
44 
49 template <class B = BigEndian>
50 struct SEAL : public SEAL_Info<B>, public SymmetricCipherDocumentation
51 {
53  typedef Encryption Decryption;
54 };
55 
57 
58 #endif
SEAL stream cipher operation.
Definition: seal.h:27
word32 m_outsideCounter
Definition: seal.h:42
Inherited by keyed algorithms with fixed key length.
Definition: seckey.h:127
uint8_t byte
Definition: Common.h:57
#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
SymmetricCipherFinal< ConcretePolicyHolder< SEAL_Policy< B >, AdditiveCipherTemplate<> >, SEAL_Info< B > > Encryption
Definition: seal.h:52
FixedSizeSecBlock< word32, 256 > m_S
Definition: seal.h:38
byte order is little-endian
Definition: cryptlib.h:126
Classes and functions for secure memory allocations.
SEAL stream cipher information.
Definition: seal.h:18
virtual void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount)=0
Operates the keystream.
Interface for algorithms that take byte strings as keys.
Definition: cryptlib.h:524
FixedSizeSecBlock< word32, 512 > m_T
Definition: seal.h:37
word32 m_startCount
Definition: seal.h:41
SEAL stream cipher.
Definition: seal.h:50
#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
#define NAMESPACE_END
Definition: config.h:201
KeystreamOperation
Keystream operation flags.
Definition: strciphr.h:90
word64 lword
Definition: config.h:245
SymmetricCipher implementation.
Definition: strciphr.h:584
SecBlock< word32 > m_R
Definition: seal.h:39
bool CipherIsRandomAccess() const
Flag indicating random access.
Definition: seal.h:33
unsigned int word32
Definition: config.h:231
CRYPTOPP_STATIC_CONSTEXPR const char * StaticAlgorithmName()
Definition: seal.h:20
Base class for additive stream ciphers with SymmetricCipher interface.
Definition: strciphr.h:267
Encryption Decryption
Definition: seal.h:53
Interface for retrieving values given their names.
Definition: cryptlib.h:279