summaryrefslogtreecommitdiff
path: root/strciphr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'strciphr.cpp')
-rw-r--r--strciphr.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/strciphr.cpp b/strciphr.cpp
index 8e53e0c..b25017e 100644
--- a/strciphr.cpp
+++ b/strciphr.cpp
@@ -2,6 +2,9 @@
#include "pch.h"
+// prevent Sun's CC compiler from including this file automatically
+#if !defined(__SUNPRO_CC) || defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES)
+
#ifndef CRYPTOPP_IMPORTS
#include "strciphr.h"
@@ -9,6 +12,18 @@
NAMESPACE_BEGIN(CryptoPP)
template <class S>
+void AdditiveCipherTemplate<S>::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params)
+{
+ PolicyInterface &policy = this->AccessPolicy();
+ policy.CipherSetKey(params, key, length);
+ m_leftOver = 0;
+ m_buffer.New(GetBufferByteSize(policy));
+
+ if (this->IsResynchronizable())
+ policy.CipherResynchronize(m_buffer, this->GetIVAndThrowIfInvalid(params));
+}
+
+template <class S>
byte AdditiveCipherTemplate<S>::GenerateByte()
{
PolicyInterface &policy = this->AccessPolicy();
@@ -109,6 +124,18 @@ void AdditiveCipherTemplate<BASE>::Seek(lword position)
}
template <class BASE>
+void CFB_CipherTemplate<BASE>::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params)
+{
+ PolicyInterface &policy = this->AccessPolicy();
+ policy.CipherSetKey(params, key, length);
+
+ if (this->IsResynchronizable())
+ policy.CipherResynchronize(this->GetIVAndThrowIfInvalid(params));
+
+ m_leftOver = policy.GetBytesPerIteration();
+}
+
+template <class BASE>
void CFB_CipherTemplate<BASE>::Resynchronize(const byte *iv)
{
PolicyInterface &policy = this->AccessPolicy();
@@ -193,3 +220,5 @@ void CFB_DecryptionTemplate<BASE>::CombineMessageAndShiftRegister(byte *output,
NAMESPACE_END
#endif
+
+#endif