13 #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 14 void SEAL_TestInstantiations()
52 m_insideCounter = m_outsideCounter = m_startCount = 0;
55 m_iterationsPerCount = L / 8192;
61 m_T[i] = gamma.
Apply(i);
64 m_S[i] = gamma.
Apply(0x1000+i);
68 for (i=0; i<m_R.size(); i++)
69 m_R[i] = gamma.
Apply(0x2000+i);
79 m_startCount = m_outsideCounter;
86 m_outsideCounter = m_startCount + (
unsigned int)(iterationCount / m_iterationsPerCount);
87 m_insideCounter = (
unsigned int)(iterationCount % m_iterationsPerCount);
97 for (
size_t iteration = 0; iteration < iterationCount; ++iteration)
99 #define Ttab(x) *(word32 *)(void*)((byte *)m_T.begin()+x) 101 a = m_outsideCounter ^ m_R[4*m_insideCounter];
102 b =
rotrFixed(m_outsideCounter, 8U) ^ m_R[4*m_insideCounter+1];
103 c =
rotrFixed(m_outsideCounter, 16U) ^ m_R[4*m_insideCounter+2];
104 d =
rotrFixed(m_outsideCounter, 24U) ^ m_R[4*m_insideCounter+3];
106 for (
unsigned int j=0; j<2; j++)
125 n1 =
d, n2 =
b, n3 =
a, n4 =
c;
144 for (
unsigned int i=0; i<64; i++)
182 #define SEAL_OUTPUT(x) \ 183 CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 0, b + m_S[4*i+0]);\ 184 CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 1, c ^ m_S[4*i+1]);\ 185 CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 2, d + m_S[4*i+2]);\ 186 CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 3, a ^ m_S[4*i+3]); 206 if (++m_insideCounter == m_iterationsPerCount)
213 a = b = c = d = n1 = n2 = n3 = n4 = 0;
SEAL stream cipher operation.
void GetUserKey(ByteOrder order, T *out, size_t outlen, const byte *in, size_t inlen)
Utility functions for the Crypto++ library.
SEAL_Gamma(const byte *key)
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount)
Operates the keystream.
#define NAMESPACE_BEGIN(x)
#define CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(x, y)
Helper macro to implement OperateKeystream.
Classes and functions for secure memory allocations.
bool IsAlignedOn(const void *ptr, unsigned int alignment)
Determines whether ptr is aligned to a minimum value.
CRYPTOPP_DLL int GetIntValueWithDefault(const char *name, int defaultValue) const
Get a named value with type int, with default.
#define CRYPTOPP_ASSERT(exp)
Classes for SEAL stream cipher.
static void CRYPTOPP_API Transform(word32 *digest, const word32 *data)
Classes for SHA-1 and SHA-2 family of message digests.
iterator begin()
Provides an iterator pointing to the first element in the memory block.
void SeekToIteration(lword iterationCount)
Seeks to a random position in the stream.
void * memcpy(void *a, const void *b, size_t c)
#define CRYPTOPP_UNUSED(x)
KeystreamOperation
Keystream operation flags.
SymmetricCipher implementation.
void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length)
Key the cipher.
T rotrFixed(T x, unsigned int y)
Performs a right rotate.
Interface for retrieving values given their names.
void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length)
Resynchronize the cipher.