summaryrefslogtreecommitdiff
path: root/strciphr.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2006-12-18 02:34:33 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2006-12-18 02:34:33 +0000
commitdaec4644fb12b026eb5210827fe66cae3928635a (patch)
tree9732b0bb2e34535743af1bc3680de2ea8d013710 /strciphr.cpp
parentecf8b8bd23401e833a901eb10ba06d0ab9482f88 (diff)
downloadcryptopp-daec4644fb12b026eb5210827fe66cae3928635a.tar.gz
update version number, port to Sun C++ 5.8
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@265 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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