summaryrefslogtreecommitdiff
path: root/seal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'seal.cpp')
-rw-r--r--seal.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/seal.cpp b/seal.cpp
index f240b50..196965f 100644
--- a/seal.cpp
+++ b/seal.cpp
@@ -71,7 +71,7 @@ void SEAL_Policy<B>::CipherSetKey(const NameValuePairs &params, const byte *key,
template <class B>
void SEAL_Policy<B>::CipherResynchronize(byte *keystreamBuffer, const byte *IV)
{
- m_outsideCounter = IV ? UnalignedGetWord<word32>(BIG_ENDIAN_ORDER, IV) : 0;
+ m_outsideCounter = IV ? GetWord<word32>(false, BIG_ENDIAN_ORDER, IV) : 0;
m_startCount = m_outsideCounter;
m_insideCounter = 0;
}
@@ -86,7 +86,6 @@ void SEAL_Policy<B>::SeekToIteration(lword iterationCount)
template <class B>
void SEAL_Policy<B>::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount)
{
- KeystreamOutput<B> keystreamOutput(operation, output, input);
word32 a, b, c, d, n1, n2, n3, n4;
unsigned int p, q;
@@ -175,10 +174,13 @@ void SEAL_Policy<B>::OperateKeystream(KeystreamOperation operation, byte *output
d = rotrFixed(d, 9U);
a += Ttab(q);
- keystreamOutput (b + m_S[4*i+0])
- (c ^ m_S[4*i+1])
- (d + m_S[4*i+2])
- (a ^ m_S[4*i+3]);
+#define SEAL_OUTPUT(x) \
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 0, b + m_S[4*i+0]);\
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 1, c ^ m_S[4*i+1]);\
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 2, d + m_S[4*i+2]);\
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 3, a ^ m_S[4*i+3]);
+
+ CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(SEAL_OUTPUT, 4*4);
if (i & 1)
{