6 #ifndef CRYPTOPP_FILTERS_H 7 #define CRYPTOPP_FILTERS_H 11 #if CRYPTOPP_MSC_VERSION 12 # pragma warning(push) 13 # pragma warning(disable: 4127 4189 4514) 47 Filter(BufferedTransformation *attachment = NULL);
56 BufferedTransformation *AttachedTransformation();
60 const BufferedTransformation *AttachedTransformation()
const;
66 void Detach(BufferedTransformation *newAttachment = NULL);
71 size_t TransferTo2(BufferedTransformation &target,
lword &transferBytes,
const std::string &channel=
DEFAULT_CHANNEL,
bool blocking=
true);
76 bool Flush(
bool hardFlush,
int propagation=-1,
bool blocking=
true);
77 bool MessageSeriesEnd(
int propagation=-1,
bool blocking=
true);
80 virtual BufferedTransformation * NewDefaultAttachment()
const;
81 void Insert(
Filter *nextFilter);
96 size_t Output(
int outputSite,
const byte *inString,
size_t length,
int messageEnd,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
106 size_t OutputModifiable(
int outputSite,
byte *inString,
size_t length,
int messageEnd,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
116 bool OutputMessageEnd(
int outputSite,
int propagation,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
135 bool OutputFlush(
int outputSite,
bool hardFlush,
int propagation,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
148 bool OutputMessageSeriesEnd(
int outputSite,
int propagation,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
180 if (m_tempSpace.size() < minSize)
183 if (desiredSize >= minSize)
185 bufferSize = desiredSize;
188 m_tempSpace.New(bufferSize);
191 bufferSize = m_tempSpace.size();
192 return m_tempSpace.begin();
201 {
return HelpCreatePutSpace(target, channel, minSize, minSize, minSize);}
210 {
return HelpCreatePutSpace(target, channel, minSize, minSize, bufferSize);}
231 : m_transparent(transparent), m_currentMessageBytes(0), m_totalBytes(0)
232 , m_currentSeriesMessages(0), m_totalMessages(0), m_totalMessageSeries(0)
233 , m_begin(NULL), m_length(0) {Detach(attachment); ResetMeter();}
246 void AddRangeToSkip(
unsigned int message,
lword position,
lword size,
bool sortNow =
true);
263 {
return AttachedTransformation()->CreatePutSpace(size);}
264 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
265 size_t PutModifiable2(
byte *inString,
size_t length,
int messageEnd,
bool blocking);
266 bool IsolatedMessageSeriesEnd(
bool blocking);
269 size_t PutMaybeModifiable(
byte *inString,
size_t length,
int messageEnd,
bool blocking,
bool modifiable);
276 {
return message <
b.message || (message ==
b.message && position <
b.position);}
335 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
337 return PutMaybeModifiable(const_cast<byte *>(inString), length, messageEnd, blocking,
false);
341 return PutMaybeModifiable(inString, length, messageEnd, blocking,
true);
349 bool IsolatedFlush(
bool hardFlush,
bool blocking);
369 virtual void FirstPut(
const byte *inString) =0;
375 virtual void NextPutMultiple(
const byte *inString,
size_t length);
378 {NextPutMultiple(inString, length);}
389 virtual void LastPut(
const byte *inString,
size_t length) =0;
393 size_t PutMaybeModifiable(
byte *begin,
size_t length,
int messageEnd,
bool blocking,
bool modifiable);
396 if (modifiable) NextPutModifiable(inString, length);
397 else NextPutMultiple(inString, length);
408 void ResetQueue(
size_t blockSize,
size_t maxBlocks);
410 byte *GetContigousBlocks(
size_t &numberOfBytes);
411 size_t GetAll(
byte *outString);
412 void Put(
const byte *inString,
size_t length);
414 size_t MaxSize()
const {
return m_buffer.size();}
441 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
446 m_inQueue.Put(inString, length);
449 IsolatedMessageEnd(blocking);
450 Output(0, NULL, 0, messageEnd, blocking);
456 virtual bool IsolatedMessageEnd(
bool blocking) =0;
506 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs &
parameters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
507 void FirstPut(
const byte *inString);
508 void NextPutMultiple(
const byte *inString,
size_t length);
509 void NextPutModifiable(
byte *inString,
size_t length);
510 void LastPut(
const byte *inString,
size_t length);
537 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
561 :
Exception(DATA_INTEGRITY_CHECK_FAILED,
"HashVerificationFilter: message hash or MAC not valid") {}
581 DEFAULT_FLAGS = HASH_AT_BEGIN | PUT_RESULT
596 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs &
parameters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
597 void FirstPut(
const byte *inString);
598 void NextPutMultiple(
const byte *inString,
size_t length);
599 void LastPut(
const byte *inString,
size_t length);
634 byte * ChannelCreatePutSpace(
const std::string &channel,
size_t &
size);
635 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking);
647 void LastPut(
const byte *inString,
size_t length);
690 byte * ChannelCreatePutSpace(
const std::string &channel,
size_t &
size);
691 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking);
695 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs &
parameters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
696 void FirstPut(
const byte *inString);
697 void NextPutMultiple(
const byte *inString,
size_t length);
709 void LastPut(
const byte *inString,
size_t length);
728 : m_rng(rng), m_signer(signer), m_messageAccumulator(signer.NewSignatureAccumulator(rng)), m_putMessage(putMessage) {Detach(attachment);}
733 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
753 :
Exception(DATA_INTEGRITY_CHECK_FAILED,
"VerifierFilter: digital signature not valid") {}
763 SIGNATURE_AT_BEGIN=1,
773 DEFAULT_FLAGS = SIGNATURE_AT_BEGIN | PUT_RESULT
791 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs &
parameters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
792 void FirstPut(
const byte *inString);
793 void NextPutMultiple(
const byte *inString,
size_t length);
794 void LastPut(
const byte *inString,
size_t length);
820 PASS_WAIT_OBJECTS = 0x02,
823 PASS_EVERYTHING = PASS_SIGNALS | PASS_WAIT_OBJECTS
829 Redirector() : m_target(NULL), m_behavior(PASS_EVERYTHING) {}
835 : m_target(&target), m_behavior(behavior) {}
851 {
return m_target ? m_target->CanModifyInput() :
false;}
857 return m_target->CreatePutSpace(size);
864 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
865 {
return m_target ? m_target->Put2(inString, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;}
866 bool Flush(
bool hardFlush,
int propagation=-1,
bool blocking=
true)
867 {
return m_target && GetPassSignals() ? m_target->Flush(hardFlush, propagation, blocking) :
false;}
869 {
return m_target && GetPassSignals() ? m_target->MessageSeriesEnd(propagation, blocking) :
false;}
874 return m_target->ChannelCreatePutSpace(channel, size);
881 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking)
882 {
return m_target ? m_target->ChannelPut2(channel, begin, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;}
884 {
return m_target ? m_target->ChannelPutModifiable2(channel, begin, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;}
885 bool ChannelFlush(
const std::string &channel,
bool completeFlush,
int propagation=-1,
bool blocking=
true)
886 {
return m_target && GetPassSignals() ? m_target->ChannelFlush(channel, completeFlush, propagation, blocking) :
false;}
888 {
return m_target && GetPassSignals() ? m_target->ChannelMessageSeriesEnd(channel, propagation, blocking) :
false;}
891 {
return m_target && GetPassWaitObjects() ? m_target->GetMaxWaitObjectCount() : 0; }
893 {
if (m_target && GetPassWaitObjects()) m_target->GetWaitObjects(container, callStack); }
921 {
return m_owner.AttachedTransformation()->CreatePutSpace(size);}
922 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
923 {
return m_owner.AttachedTransformation()->Put2(inString, length, m_passSignal ? messageEnd : 0, blocking);}
925 {
return m_owner.AttachedTransformation()->PutModifiable2(begin, length, m_passSignal ? messageEnd : 0, blocking);}
927 {
if (m_passSignal) m_owner.AttachedTransformation()->Initialize(
parameters, propagation);}
928 bool Flush(
bool hardFlush,
int propagation=-1,
bool blocking=
true)
929 {
return m_passSignal ? m_owner.AttachedTransformation()->Flush(hardFlush, propagation, blocking) :
false;}
931 {
return m_passSignal ? m_owner.AttachedTransformation()->MessageSeriesEnd(propagation, blocking) :
false;}
934 {
return m_owner.AttachedTransformation()->ChannelCreatePutSpace(channel, size);}
935 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking)
936 {
return m_owner.AttachedTransformation()->ChannelPut2(channel, begin, length, m_passSignal ? messageEnd : 0, blocking);}
938 {
return m_owner.AttachedTransformation()->ChannelPutModifiable2(channel, begin, length, m_passSignal ? messageEnd : 0, blocking);}
939 bool ChannelFlush(
const std::string &channel,
bool completeFlush,
int propagation=-1,
bool blocking=
true)
940 {
return m_passSignal ? m_owner.AttachedTransformation()->ChannelFlush(channel, completeFlush, propagation, blocking) :
false;}
942 {
return m_passSignal ? m_owner.AttachedTransformation()->ChannelMessageSeriesEnd(channel, propagation, blocking) :
false;}
963 bool IsolatedFlush(
bool hardFlush,
bool blocking);
967 void SetFilter(
Filter *filter);
968 void NextPutMultiple(
const byte *s,
size_t len);
969 void NextPutModifiable(
byte *inString,
size_t length);
1049 {
if (!parameters.
GetValue(
"OutputStringPointer", m_output))
throw InvalidArgument(
"StringSink: OutputStringPointer not specified");}
1051 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
1054 typedef typename T::traits_type::char_type char_type;
1058 typename T::size_type
size = m_output->size();
1059 if (length < size && size + length > m_output->capacity())
1060 m_output->reserve(2*size);
1061 m_output->append((
const char_type *)inString, (
const char_type *)inString+length);
1093 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
1110 : m_buf(NULL), m_size(0), m_total(0) {IsolatedInitialize(
parameters);}
1116 : m_buf(buf), m_size(size), m_total(0) {}
1127 byte * CreatePutSpace(
size_t &
size);
1128 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
1149 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
1192 : m_rng(NULL), m_length(0), m_count(0) {}
1195 : m_rng(&rng), m_length(length), m_count(0) {}
1204 throw NotImplemented(
"RandomNumberStore: CopyRangeTo2() is not supported by this store");
1259 {Pump2(pumpMax);
return pumpMax;}
1280 virtual size_t Pump2(
lword &byteCount,
bool blocking=
true) =0;
1286 virtual size_t PumpMessages2(
unsigned int &messageCount,
bool blocking=
true) =0;
1291 virtual size_t PumpAll2(
bool blocking=
true);
1295 virtual bool SourceExhausted()
const =0;
1302 IsolatedInitialize(parameters);
1323 {m_store.IsolatedInitialize(parameters);}
1325 {
return m_store.TransferTo2(*AttachedTransformation(), byteCount,
DEFAULT_CHANNEL, blocking);}
1327 {
return m_store.TransferMessagesTo2(*AttachedTransformation(), messageCount,
DEFAULT_CHANNEL, blocking);}
1329 {
return m_store.TransferAllTo2(*AttachedTransformation(),
DEFAULT_CHANNEL, blocking);}
1331 {
return !m_store.AnyRetrievable() && !m_store.AnyMessages();}
1333 {m_store.SetAutoSignalPropagation(propagation);}
1335 {
return m_store.GetAutoSignalPropagation();}
1387 {SourceInitialize(pumpAll,
MakeParameters(
"RandomNumberGeneratorPointer", &rng)(
"RandomNumberStoreSize", length));}
1392 #if CRYPTOPP_MSC_VERSION 1393 # pragma warning(pop) Used to pass byte array input as part of a NameValuePairs object.
Create a working space in a BufferedTransformation.
Base class for all exceptions thrown by the library.
Append input to a string object.
An invalid argument was detected.
byte * HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize, size_t bufferSize)
Create a working space in a BufferedTransformation.
StringSource(const char *string, bool pumpAll, BufferedTransformation *attachment=NULL)
Construct a StringSource.
SimpleProxyFilter(BufferedTransformation *filter, BufferedTransformation *attachment)
Construct a SimpleProxyFilter.
HashTransformation & m_hashModule
Pointer-based implementation of the Source interface.
DOCUMENTED_TYPEDEF(StringSinkTemplate< std::string >, StringSink)
Classes for working with NameValuePairs.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const
Copy bytes from this object to another BufferedTransformation.
Filter wrapper for PK_Verifier.
Base class for Filter classes that are proxies for a chain of other filters.
Implementation of BufferedTransformation's attachment interface.
std::string AlgorithmName() const
Provides the name of this algorithm.
Classes providing basic library services.
Utility functions for the Crypto++ library.
PK_DecryptorFilter(RandomNumberGenerator &rng, const PK_Decryptor &decryptor, BufferedTransformation *attachment=NULL)
Construct a PK_DecryptorFilter.
MeterFilter(BufferedTransformation *attachment=NULL, bool transparent=true)
Construct a MeterFilter.
std::string AlgorithmName() const
Provides the name of this algorithm.
bool operator<(const MessageRange &b) const
unsigned int GetTotalMessages() const
void SetAutoSignalPropagation(int propagation)
Set propagation of automatically generated and transferred signals.
BlockPaddingScheme
Padding schemes used for block ciphers.
member_ptr< BufferedTransformation > m_filter
Interface for one direction (encryption or decryption) of a stream cipher or block cipher mode with a...
SecByteBlock m_expectedHash
RandomNumberGenerator & m_rng
bool GetLastResult() const
Filter class that is a proxy for a sink.
size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes that may be modified by callee on a channel.
size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing on a channel.
#define NAMESPACE_BEGIN(x)
byte * HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize)
Create a working space in a BufferedTransformation.
Interface for public-key signers.
#define CRYPTOPP_DLL_TEMPLATE_CLASS
size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing on a channel.
Interface for public-key encryptors.
void PumpAll()
Pump all data to attached transformation.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
unsigned int PumpMessages(unsigned int count=UINT_MAX)
Pump messages to attached transformation.
Abstract base classes that provide a uniform interface to this library.
member_ptr< BufferedTransformation > m_attachment
std::string AlgorithmName() const
Provides the name of this algorithm.
void SetPassWaitObjects(bool pass)
bool GetPassSignal() const
Retrieve passSignal flag.
bool ShouldPropagateMessageSeriesEnd() const
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
size_t PumpAll2(bool blocking=true)
Pump all data to attached transformation.
Classes for automatic resource management.
Filter wrapper for PK_Signer.
bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true)
Marks the end of a series of messages on a channel.
Acts as a Source for pre-existing, static data.
StringStore(const T &string)
Construct a StringStore.
StringSource(const byte *string, size_t length, bool pumpAll, BufferedTransformation *attachment=NULL)
Construct a StringSource.
Interface for random number generators.
StreamTransformationFilter m_streamFilter
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
Append input to a string object.
BufferedTransformation & m_owner
StringSource(const std::string &string, bool pumpAll, BufferedTransformation *attachment=NULL)
Construct a StringSource.
Exception thrown when an invalid signature is encountered.
Flags
Flags controlling filter behavior.
virtual bool ShouldPropagateMessageSeriesEnd() const
std::string AlgorithmName() const
Provides the name of this algorithm.
StringStore(const byte *string, size_t length)
Construct a StringStore.
bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output on a channel.
byte * ChannelCreatePutSpace(const std::string &channel, size_t &size)
Request space which can be written into by the caller.
HashTransformation & m_hashModule
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
Exception thrown when a data integrity check failure is encountered.
Classes and functions for secure memory allocations.
1 and 0's padding added to a block
void SetPassSignals(bool pass)
Redirector(BufferedTransformation &target, Behavior behavior=PASS_EVERYTHING)
Construct a Redirector.
void StoreInitialize(const NameValuePairs ¶meters)
Copy input to a memory buffer.
unsigned int GetTotalMessageSeries() const
virtual ~AuthenticatedEncryptionFilter()
Flags
Flags controlling filter behavior.
byte * ChannelCreatePutSpace(const std::string &channel, size_t &size)
Request space which can be written into by the caller.
Transform a Store into a Source.
Classes for an unlimited queue to store bytes.
Xor input to a memory buffer.
RandomNumberSink(RandomNumberGenerator &rng)
Construct a RandomNumberSink.
bool GetValue(const char *name, T &value) const
Get a named value.
bool CanModifyInput() const
Determines whether input can be modified by the callee.
Interface for public-key decryptors.
A method was called which was not implemented.
bool GetLastResult() const
Filter wrapper for HashTransformation.
Filter wrapper for HashTransformation.
RNG-based implementation of Source interface.
Filter wrapper for decrypting with AuthenticatedSymmetricCipher.
const PK_Verifier & m_verifier
void Detach(BufferedTransformation *newAttachment=NULL)
Replace an attached transformation.
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
NullStore(lword size=ULONG_MAX)
bool GetPassSignals() const
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
OutputProxy(BufferedTransformation &owner, bool passSignal)
Construct an OutputProxy.
A non-transparent MeterFilter.
virtual ~StringSinkTemplate()
Filter wrapper for encrypting with AuthenticatedSymmetricCipher.
size_t PumpMessages2(unsigned int &messageCount, bool blocking=true)
Pump messages to attached transformation.
Flags
Flags controlling filter behavior.
std::string AlgorithmName() const
Provides the name of this algorithm.
Proxy filter that doesn't modify the underlying filter's input or output.
void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1)
Initialize or reinitialize this object, with signal propagation.
bool MessageSeriesEnd(int propagation=-1, bool blocking=true)
Marks the end of a series of messages, with signal propagation.
unsigned int GetMaxWaitObjectCount() const
Retrieves the maximum number of waitable objects.
virtual bool ShouldPropagateMessageEnd() const
unsigned int m_digestSize
T1 SaturatingSubtract(const T1 &a, const T2 &b)
Performs a saturating subtract clamped at 0.
RandomNumberSource(RandomNumberGenerator &rng, int length, bool pumpAll, BufferedTransformation *attachment=NULL)
void StopRedirection()
Stop redirecting input.
size_t AvailableSize()
Provides the size remaining in the Sink.
Filter wrapper for PK_Decryptor.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
lword Pump(lword pumpMax=(size_t) SIZE_MAX)
Pump data to attached transformation.
void FirstPut(const byte *inString)
void SetBehavior(Behavior behavior)
BufferedTransformation * m_target
member_ptr< PK_MessageAccumulator > m_messageAccumulator
Incorporates input into RNG as additional entropy.
virtual ~HashVerificationFilter()
virtual ~AuthenticatedDecryptionFilter()
#define THROW_EXCEPTION(X)
RandomNumberGenerator * m_rng
unsigned int m_digestSize
lword GetTotalBytes() const
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
RandomNumberSink()
Construct a RandomNumberSink.
StringSource(BufferedTransformation *attachment=NULL)
Construct a StringSource.
String-based implementation of Store interface.
#define CRYPTOPP_ASSERT(exp)
const NameValuePairs & g_nullNameValuePairs
An empty set of name-value pairs.
int GetAutoSignalPropagation() const
Retrieve automatic signal propagation value.
virtual ~SignatureVerificationFilter()
Redirect input to another BufferedTransformation without owning it.
virtual ~FilterPutSpaceHelper()
size_t Pump2(lword &byteCount, bool blocking=true)
Pump data to attached transformation.
Data structure used to store byte strings.
TransparentFilter(BufferedTransformation *attachment=NULL)
Construct a TransparentFilter.
Redirector()
Construct a Redirector.
bool GetLastResult() const
Retrieves the result of the last verification.
#define CRYPTOPP_NO_VTABLE
void SourceInitialize(bool pumpAll, const NameValuePairs ¶meters)
bool AnyRetrievable() const
Determines whether bytes are ready for retrieval.
SignatureVerificationFailed()
RandomNumberStore(RandomNumberGenerator &rng, lword length)
Filter wrapper for PK_Encryptor.
void Redirect(BufferedTransformation &target)
Redirect input to another BufferedTransformation.
Behavior
Controls signal propagation behavior.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
#define pass(a, b, c, mul, X)
Base class for unflushable filters.
Interface for public-key signature verifiers.
bool Attachable()
Determine if attachable.
uint8_t const size_t const size
A transparent MeterFilter.
SecByteBlock m_tempSpace
Temporay working space.
#define CRYPTOPP_UNUSED(x)
bool SourceExhausted() const
Determines if the Source is exhausted.
HashVerificationFilter m_hashVerifier
lword GetCurrentMessageBytes() const
void SetPassSignal(bool passSignal)
Set passSignal flag.
SignerFilter(RandomNumberGenerator &rng, const PK_Signer &signer, BufferedTransformation *attachment=NULL, bool putMessage=false)
Construct a SignerFilter.
bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output on a channel.
0's padding added to a block
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
void SetTransparent(bool transparent)
Set or change the transparent mode of this object.
SignatureVerificationFilter VerifierFilter
ArraySink(const NameValuePairs ¶meters=g_nullNameValuePairs)
Construct an ArraySink.
Implementation of BufferedTransformation's attachment interface.
bool ShouldPropagateMessageEnd() const
Access a block of memory.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
Measure how many bytes and messages pass through the filter.
const PK_Signer & m_signer
void GetWaitObjects(WaitObjectContainer &container, CallStack const &callStack)
Retrieves waitable objects.
std::vector< char * > parameters
No padding added to a block.
ArrayXorSink(byte *buf, size_t size)
Construct an ArrayXorSink.
PKCS #5 padding added to a block.
Padding schemes used for block ciphers.
PK_EncryptorFilter(RandomNumberGenerator &rng, const PK_Encryptor &encryptor, BufferedTransformation *attachment=NULL)
Construct a PK_EncryptorFilter.
std::deque< MessageRange > m_rangesToSkip
ArraySink(byte *buf, size_t size)
Construct an ArraySink.
StringSinkTemplate(T &output)
Construct a StringSinkTemplate.
virtual ~SourceTemplate()
RNG-based implementation of Source interface.
bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true)
Marks the end of a series of messages on a channel.
member_ptr< PK_MessageAccumulator > m_messageAccumulator
virtual ~RandomNumberSink()
size_t PutModifiable2(byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes that may be modified by callee.
virtual ~RandomNumberStore()
unsigned int m_totalMessageSeries
byte * HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize, size_t desiredSize, size_t &bufferSize)
Create a working space in a BufferedTransformation.
OpaqueFilter(BufferedTransformation *attachment=NULL)
Construct an OpaqueFilter.
Ensures an object is not copyable.
std::string m_messagePutChannel
bool Flush(bool hardFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output, with signal propagation.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
StringStore(const char *string=NULL)
Construct a StringStore.
Interface for custom flush signals.
bool Flush(bool hardFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output, with signal propagation.
bool GetPassWaitObjects() const
size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes that may be modified by callee on a channel.
RandomNumberGenerator * m_rng
lword TotalPutLength()
Provides the number of bytes written to the Sink.
void LastPut(const byte *inString, size_t length)
Input the last block of data.
Base class for bufferless filters.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
Interface for retrieving values given their names.
bool MessageSeriesEnd(int propagation=-1, bool blocking=true)
Marks the end of a series of messages, with signal propagation.
unsigned int GetCurrentSeriesMessages() const
Source(BufferedTransformation *attachment=NULL)
Construct a Source.