From daec4644fb12b026eb5210827fe66cae3928635a Mon Sep 17 00:00:00 2001 From: weidai Date: Mon, 18 Dec 2006 02:34:33 +0000 Subject: 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 --- strciphr.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'strciphr.cpp') diff --git a/strciphr.cpp b/strciphr.cpp index 8e53e0c..b25017e 100644 --- a/strciphr.cpp +++ b/strciphr.cpp @@ -2,12 +2,27 @@ #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" NAMESPACE_BEGIN(CryptoPP) +template +void AdditiveCipherTemplate::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) +{ + 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 byte AdditiveCipherTemplate::GenerateByte() { @@ -108,6 +123,18 @@ void AdditiveCipherTemplate::Seek(lword position) m_leftOver = 0; } +template +void CFB_CipherTemplate::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) +{ + PolicyInterface &policy = this->AccessPolicy(); + policy.CipherSetKey(params, key, length); + + if (this->IsResynchronizable()) + policy.CipherResynchronize(this->GetIVAndThrowIfInvalid(params)); + + m_leftOver = policy.GetBytesPerIteration(); +} + template void CFB_CipherTemplate::Resynchronize(const byte *iv) { @@ -193,3 +220,5 @@ void CFB_DecryptionTemplate::CombineMessageAndShiftRegister(byte *output, NAMESPACE_END #endif + +#endif -- cgit v1.2.1