Crypto++
seal.h
1 #ifndef CRYPTOPP_SEAL_H
2 #define CRYPTOPP_SEAL_H
3 
4 #include "strciphr.h"
5 
6 NAMESPACE_BEGIN(CryptoPP)
7 
8 //! _
9 template <class B = BigEndian>
10 struct SEAL_Info : public FixedKeyLength<20, SimpleKeyingInterface::INTERNALLY_GENERATED_IV, 4>
11 {
12  static const char *StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "SEAL-3.0-LE" : "SEAL-3.0-BE";}
13 };
14 
15 template <class B = BigEndian>
16 class CRYPTOPP_NO_VTABLE SEAL_Policy : public AdditiveCipherConcretePolicy<word32, 256>, public SEAL_Info<B>
17 {
18 protected:
19  void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
20  void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
21  void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length);
22  bool CipherIsRandomAccess() const {return true;}
23  void SeekToIteration(lword iterationCount);
24 
25 private:
28  SecBlock<word32> m_R;
29 
30  word32 m_startCount, m_iterationsPerCount;
31  word32 m_outsideCounter, m_insideCounter;
32 };
33 
34 //! <a href="http://www.weidai.com/scan-mirror/cs.html#SEAL-3.0-BE">SEAL</a>
35 template <class B = BigEndian>
36 struct SEAL : public SEAL_Info<B>, public SymmetricCipherDocumentation
37 {
39  typedef Encryption Decryption;
40 };
41 
42 NAMESPACE_END
43 
44 #endif
to be inherited by keyed algorithms with fixed key length
Definition: seckey.h:66
_
Definition: seal.h:10
keying interface for crypto algorithms that take byte strings as keys
Definition: cryptlib.h:346
SEAL
Definition: seal.h:36
Each class derived from this one defines two types, Encryption and Decryption, both of which implemen...
Definition: seckey.h:201
interface for retrieving values given their names
Definition: cryptlib.h:224