Security Scol plugin
seal.h
Go to the documentation of this file.
1// seal.h - originally written and placed in the public domain by Wei Dai
2
6
7#ifndef CRYPTOPP_SEAL_H
8#define CRYPTOPP_SEAL_H
9
10#include "strciphr.h"
11#include "secblock.h"
12
13NAMESPACE_BEGIN(CryptoPP)
14
15
18template <class B = BigEndian>
19struct SEAL_Info : public FixedKeyLength<20, SimpleKeyingInterface::INTERNALLY_GENERATED_IV, 4>
20{
21 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "SEAL-3.0-LE" : "SEAL-3.0-BE";}
22};
23
27template <class B = BigEndian>
28class CRYPTOPP_NO_VTABLE SEAL_Policy : public AdditiveCipherConcretePolicy<word32, 256>, public SEAL_Info<B>
29{
30protected:
31 void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
32 void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
33 void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length);
34 bool CipherIsRandomAccess() const {return true;}
35 void SeekToIteration(lword iterationCount);
36
37private:
41
42 word32 m_startCount, m_iterationsPerCount;
43 word32 m_outsideCounter, m_insideCounter;
44};
45
50template <class B = BigEndian>
56
57NAMESPACE_END
58
59#endif
Base class for additive stream ciphers with SymmetricCipher interface.
Definition strciphr.h:298
Inherited by keyed algorithms with fixed key length.
Definition seckey.h:125
Fixed size stack-based SecBlock.
Definition secblock.h:1246
Interface for retrieving values given their names.
Definition cryptlib.h:322
SEAL stream cipher operation.
Definition seal.h:29
bool CipherIsRandomAccess() const
Flag indicating random access.
Definition seal.h:34
Secure memory block with allocator and cleanup.
Definition secblock.h:731
SymmetricCipher implementation.
Definition strciphr.h:684
unsigned int word32
32-bit unsigned datatype
Definition config_int.h:62
word64 lword
Large word type.
Definition config_int.h:158
@ LITTLE_ENDIAN_ORDER
byte order is little-endian
Definition cryptlib.h:145
Classes and functions for secure memory allocations.
Classes for implementing stream ciphers.
KeystreamOperation
Keystream operation flags.
Definition strciphr.h:88
virtual void SeekToIteration(lword iterationCount)
Seeks to a random position in the stream.
Definition strciphr.h:174
virtual void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length)=0
Key the cipher.
virtual void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length)
Resynchronize the cipher.
Definition strciphr.h:163
Base class for additive stream ciphers.
Definition strciphr.h:202
virtual void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount)=0
Operates the keystream.
SEAL stream cipher information.
Definition seal.h:20
SEAL stream cipher.
Definition seal.h:52
Provides Encryption and Decryption typedefs used by derived classes to implement a symmetric cipher.
Definition seckey.h:414