summaryrefslogtreecommitdiff
path: root/filters.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-03-20 01:24:12 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-03-20 01:24:12 +0000
commitd23a489940499bd6c634a1cb0a9875f094f8a850 (patch)
treef85b3bed971083e90e5f3dbb84539ea4ba0359e9 /filters.h
parentb3517523a738277cfe22428bd757833e69abb66e (diff)
downloadcryptopp-d23a489940499bd6c634a1cb0a9875f094f8a850.tar.gz
various changes for 5.1
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@38 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'filters.h')
-rw-r--r--filters.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/filters.h b/filters.h
index 1b8965b..b2ddec2 100644
--- a/filters.h
+++ b/filters.h
@@ -324,8 +324,8 @@ public:
private:
RandomNumberGenerator &m_rng;
- const PK_Signer &m_signer;
- member_ptr<HashTransformation> m_messageAccumulator;
+ const PK_Signer &m_signer;
+ member_ptr<PK_MessageAccumulator> m_messageAccumulator;
bool m_putMessage;
SecByteBlock m_buf;
};
@@ -354,7 +354,7 @@ protected:
private:
const PK_Verifier &m_verifier;
- member_ptr<HashTransformation> m_messageAccumulator;
+ member_ptr<PK_MessageAccumulator> m_messageAccumulator;
word32 m_flags;
SecByteBlock m_signature;
bool m_verified;
@@ -474,8 +474,8 @@ public:
class PK_DecryptorFilter : public SimpleProxyFilter
{
public:
- PK_DecryptorFilter(const PK_Decryptor &decryptor, BufferedTransformation *attachment = NULL)
- : SimpleProxyFilter(decryptor.CreateDecryptionFilter(), attachment) {}
+ PK_DecryptorFilter(RandomNumberGenerator &rng, const PK_Decryptor &decryptor, BufferedTransformation *attachment = NULL)
+ : SimpleProxyFilter(decryptor.CreateDecryptionFilter(rng), attachment) {}
};
//! Append input to a string object
@@ -491,9 +491,16 @@ public:
void IsolatedInitialize(const NameValuePairs &parameters)
{if (!parameters.GetValue("OutputStringPointer", m_output)) throw InvalidArgument("StringSink: OutputStringPointer not specified");}
+
unsigned int Put2(const byte *begin, unsigned int length, int messageEnd, bool blocking)
{
- m_output->append((const char_type *)begin, (const char_type *)begin+length);
+ if (length > 0)
+ {
+ typename T::size_type size = m_output->size();
+ if (length < size && size + length > m_output->capacity())
+ m_output->reserve(2*size);
+ m_output->append((const char_type *)begin, (const char_type *)begin+length);
+ }
return 0;
}