7 #ifndef CRYPTOPP_FILTERS_H 8 #define CRYPTOPP_FILTERS_H 14 #if CRYPTOPP_MSC_VERSION 15 # pragma warning(push) 16 # pragma warning(disable: 4127 4189) 45 Filter(BufferedTransformation *attachment = NULL);
54 BufferedTransformation *AttachedTransformation();
58 const BufferedTransformation *AttachedTransformation()
const;
64 void Detach(BufferedTransformation *newAttachment = NULL);
67 size_t TransferTo2(BufferedTransformation &target, lword &transferBytes,
const std::string &channel=
DEFAULT_CHANNEL,
bool blocking=
true);
68 size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX,
const std::string &channel=
DEFAULT_CHANNEL,
bool blocking=
true)
const;
72 bool Flush(
bool hardFlush,
int propagation=-1,
bool blocking=
true);
73 bool MessageSeriesEnd(
int propagation=-1,
bool blocking=
true);
75 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 80 virtual BufferedTransformation * NewDefaultAttachment()
const;
81 void Insert(
Filter *nextFilter);
83 virtual bool ShouldPropagateMessageEnd()
const {
return true;}
84 virtual bool ShouldPropagateMessageSeriesEnd()
const {
return true;}
86 void PropagateInitialize(
const NameValuePairs ¶meters,
int propagation);
97 size_t Output(
int outputSite,
const byte *inString,
size_t length,
int messageEnd,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
108 size_t OutputModifiable(
int outputSite, byte *inString,
size_t length,
int messageEnd,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
117 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);
147 bool OutputMessageSeriesEnd(
int outputSite,
int propagation,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
153 size_t m_inputPosition;
162 byte *HelpCreatePutSpace(
BufferedTransformation &target,
const std::string &channel,
size_t minSize,
size_t desiredSize,
size_t &bufferSize)
164 assert(desiredSize >= minSize && bufferSize >= minSize);
165 if (m_tempSpace.size() < minSize)
168 if (desiredSize >= minSize)
170 bufferSize = desiredSize;
173 m_tempSpace.New(bufferSize);
176 bufferSize = m_tempSpace.size();
177 return m_tempSpace.begin();
180 {
return HelpCreatePutSpace(target, channel, minSize, minSize, minSize);}
181 byte *HelpCreatePutSpace(
BufferedTransformation &target,
const std::string &channel,
size_t minSize,
size_t bufferSize)
182 {
return HelpCreatePutSpace(target, channel, minSize, minSize, bufferSize);}
191 : m_transparent(transparent), m_currentMessageBytes(0), m_totalBytes(0)
192 , m_currentSeriesMessages(0), m_totalMessages(0), m_totalMessageSeries(0)
193 , m_begin(NULL), m_length(0) {Detach(attachment); ResetMeter();}
195 void SetTransparent(
bool transparent) {m_transparent = transparent;}
196 void AddRangeToSkip(
unsigned int message, lword position, lword size,
bool sortNow =
true);
199 {CRYPTOPP_UNUSED(parameters); ResetMeter();}
201 lword GetCurrentMessageBytes()
const {
return m_currentMessageBytes;}
202 lword GetTotalBytes() {
return m_totalBytes;}
203 unsigned int GetCurrentSeriesMessages() {
return m_currentSeriesMessages;}
204 unsigned int GetTotalMessages() {
return m_totalMessages;}
205 unsigned int GetTotalMessageSeries() {
return m_totalMessageSeries;}
208 {
return AttachedTransformation()->CreatePutSpace(size);}
209 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
210 size_t PutModifiable2(byte *inString,
size_t length,
int messageEnd,
bool blocking);
211 bool IsolatedMessageSeriesEnd(
bool blocking);
214 size_t PutMaybeModifiable(byte *inString,
size_t length,
int messageEnd,
bool blocking,
bool modifiable);
215 bool ShouldPropagateMessageEnd()
const {
return m_transparent;}
216 bool ShouldPropagateMessageSeriesEnd()
const {
return m_transparent;}
220 inline bool operator<(
const MessageRange &b)
const 221 {
return message < b.message || (message == b.message && position < b.position);}
222 unsigned int message; lword position; lword size;
226 lword m_currentMessageBytes, m_totalBytes;
227 unsigned int m_currentSeriesMessages, m_totalMessages, m_totalMessageSeries;
228 std::deque<MessageRange> m_rangesToSkip;
256 #if !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) 267 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
269 return PutMaybeModifiable(const_cast<byte *>(inString), length, messageEnd, blocking,
false);
271 size_t PutModifiable2(byte *inString,
size_t length,
int messageEnd,
bool blocking)
273 return PutMaybeModifiable(inString, length, messageEnd, blocking,
true);
276 bool IsolatedFlush(
bool hardFlush,
bool blocking);
284 bool DidFirstPut() {
return m_firstInputDone;}
286 virtual void InitializeDerivedAndReturnNewSizes(
const NameValuePairs ¶meters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize)
287 {CRYPTOPP_UNUSED(parameters); CRYPTOPP_UNUSED(firstSize); CRYPTOPP_UNUSED(blockSize); CRYPTOPP_UNUSED(lastSize); InitializeDerived(parameters);}
289 {CRYPTOPP_UNUSED(parameters);}
292 virtual void FirstPut(
const byte *inString) =0;
294 virtual void NextPutSingle(
const byte *inString)
295 {CRYPTOPP_UNUSED(inString); assert(
false);}
298 virtual void NextPutMultiple(
const byte *inString,
size_t length);
300 virtual void NextPutModifiable(byte *inString,
size_t length)
301 {NextPutMultiple(inString, length);}
306 virtual void LastPut(
const byte *inString,
size_t length) =0;
307 virtual void FlushDerived() {}
310 size_t PutMaybeModifiable(byte *begin,
size_t length,
int messageEnd,
bool blocking,
bool modifiable);
311 void NextPutMaybeModifiable(byte *inString,
size_t length,
bool modifiable)
313 if (modifiable) NextPutModifiable(inString, length);
314 else NextPutMultiple(inString, length);
319 virtual int NextPut(
const byte *inString,
size_t length)
320 {CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); assert(
false);
return 0;}
325 void ResetQueue(
size_t blockSize,
size_t maxBlocks);
327 byte *GetContigousBlocks(
size_t &numberOfBytes);
328 size_t GetAll(byte *outString);
329 void Put(
const byte *inString,
size_t length);
330 size_t CurrentSize()
const {
return m_size;}
331 size_t MaxSize()
const {
return m_buffer.size();}
335 size_t m_blockSize, m_maxBlocks, m_size;
339 size_t m_firstSize, m_blockSize, m_lastSize;
340 bool m_firstInputDone;
350 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
355 m_inQueue.Put(inString, length);
358 IsolatedMessageEnd(blocking);
359 Output(0, NULL, 0, messageEnd, blocking);
365 virtual bool IsolatedMessageEnd(
bool blocking) =0;
367 {CRYPTOPP_UNUSED(parameters); m_inQueue.Clear();}
406 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs ¶meters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
407 void FirstPut(
const byte *inString);
408 void NextPutMultiple(
const byte *inString,
size_t length);
409 void NextPutModifiable(byte *inString,
size_t length);
410 void LastPut(
const byte *inString,
size_t length);
416 unsigned int m_optimalBufferSize;
419 #ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY 431 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
432 byte *
CreatePutSpace(
size_t &size) {
return m_hashModule.CreateUpdateSpace(size);}
437 unsigned int m_digestSize;
439 std::string m_messagePutChannel, m_hashPutChannel;
450 :
Exception(DATA_INTEGRITY_CHECK_FAILED,
"HashVerificationFilter: message hash or MAC not valid") {}
453 enum Flags {HASH_AT_END=0, HASH_AT_BEGIN=1, PUT_MESSAGE=2, PUT_HASH=4, PUT_RESULT=8, THROW_EXCEPTION=16, DEFAULT_FLAGS = HASH_AT_BEGIN | PUT_RESULT};
457 bool GetLastResult()
const {
return m_verified;}
460 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs ¶meters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
461 void FirstPut(
const byte *inString);
462 void NextPutMultiple(
const byte *inString,
size_t length);
463 void LastPut(
const byte *inString,
size_t length);
470 unsigned int m_digestSize;
486 byte * ChannelCreatePutSpace(
const std::string &channel,
size_t &size);
487 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking);
488 void LastPut(
const byte *inString,
size_t length);
499 enum Flags {MAC_AT_END=0, MAC_AT_BEGIN=1, THROW_EXCEPTION=16, DEFAULT_FLAGS = THROW_EXCEPTION};
505 byte * ChannelCreatePutSpace(
const std::string &channel,
size_t &size);
506 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking);
507 bool GetLastResult()
const {
return m_hashVerifier.GetLastResult();}
510 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs ¶meters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
511 void FirstPut(
const byte *inString);
512 void NextPutMultiple(
const byte *inString,
size_t length);
513 void LastPut(
const byte *inString,
size_t length);
524 : m_rng(rng), m_signer(signer), m_messageAccumulator(signer.
NewSignatureAccumulator(rng)), m_putMessage(putMessage) {Detach(attachment);}
529 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
547 :
Exception(DATA_INTEGRITY_CHECK_FAILED,
"VerifierFilter: digital signature not valid") {}
550 enum Flags {SIGNATURE_AT_END=0, SIGNATURE_AT_BEGIN=1, PUT_MESSAGE=2, PUT_SIGNATURE=4, PUT_RESULT=8, THROW_EXCEPTION=16, DEFAULT_FLAGS = SIGNATURE_AT_BEGIN | PUT_RESULT};
555 bool GetLastResult()
const {
return m_verified;}
558 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs ¶meters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
559 void FirstPut(
const byte *inString);
560 void NextPutMultiple(
const byte *inString,
size_t length);
561 void LastPut(
const byte *inString,
size_t length);
585 PASS_WAIT_OBJECTS = 0x02,
588 PASS_EVERYTHING = PASS_SIGNALS | PASS_WAIT_OBJECTS
591 Redirector() : m_target(NULL), m_behavior(PASS_EVERYTHING) {}
593 : m_target(&target), m_behavior(behavior) {}
596 void StopRedirection() {m_target = NULL;}
599 void SetBehavior(
Behavior behavior) {m_behavior=behavior;}
600 bool GetPassSignals()
const {
return (m_behavior & PASS_SIGNALS) != 0;}
601 void SetPassSignals(
bool pass) {
if (pass) m_behavior |= PASS_SIGNALS;
else m_behavior &= ~(word32) PASS_SIGNALS; }
602 bool GetPassWaitObjects()
const {
return (m_behavior & PASS_WAIT_OBJECTS) != 0;}
603 void SetPassWaitObjects(
bool pass) {
if (pass) m_behavior |= PASS_WAIT_OBJECTS;
else m_behavior &= ~(word32) PASS_WAIT_OBJECTS; }
606 {
return m_target ? m_target->CanModifyInput() :
false;}
608 void Initialize(
const NameValuePairs ¶meters,
int propagation);
610 {
return m_target ? m_target->CreatePutSpace(size) : (byte *)(size=0, NULL);}
611 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
612 {
return m_target ? m_target->Put2(inString, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;}
613 bool Flush(
bool hardFlush,
int propagation=-1,
bool blocking=
true)
614 {
return m_target && GetPassSignals() ? m_target->Flush(hardFlush, propagation, blocking) :
false;}
616 {
return m_target && GetPassSignals() ? m_target->MessageSeriesEnd(propagation, blocking) :
false;}
619 {
return m_target ? m_target->ChannelCreatePutSpace(channel, size) : (byte *)(size=0, NULL);}
620 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking)
621 {
return m_target ? m_target->ChannelPut2(channel, begin, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;}
623 {
return m_target ? m_target->ChannelPutModifiable2(channel, begin, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;}
624 bool ChannelFlush(
const std::string &channel,
bool completeFlush,
int propagation=-1,
bool blocking=
true)
625 {
return m_target && GetPassSignals() ? m_target->ChannelFlush(channel, completeFlush, propagation, blocking) :
false;}
627 {
return m_target && GetPassSignals() ? m_target->ChannelMessageSeriesEnd(channel, propagation, blocking) :
false;}
630 {
return m_target && GetPassWaitObjects() ? m_target->GetMaxWaitObjectCount() : 0; }
632 {
if (m_target && GetPassWaitObjects()) m_target->GetWaitObjects(container, callStack); }
645 bool GetPassSignal()
const {
return m_passSignal;}
646 void SetPassSignal(
bool passSignal) {m_passSignal = passSignal;}
649 {
return m_owner.AttachedTransformation()->CreatePutSpace(size);}
650 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
651 {
return m_owner.AttachedTransformation()->Put2(inString, length, m_passSignal ? messageEnd : 0, blocking);}
653 {
return m_owner.AttachedTransformation()->PutModifiable2(begin, length, m_passSignal ? messageEnd : 0, blocking);}
655 {
if (m_passSignal) m_owner.AttachedTransformation()->Initialize(parameters, propagation);}
656 bool Flush(
bool hardFlush,
int propagation=-1,
bool blocking=
true)
657 {
return m_passSignal ? m_owner.AttachedTransformation()->Flush(hardFlush, propagation, blocking) :
false;}
659 {
return m_passSignal ? m_owner.AttachedTransformation()->MessageSeriesEnd(propagation, blocking) :
false;}
662 {
return m_owner.AttachedTransformation()->ChannelCreatePutSpace(channel, size);}
663 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking)
664 {
return m_owner.AttachedTransformation()->ChannelPut2(channel, begin, length, m_passSignal ? messageEnd : 0, blocking);}
666 {
return m_owner.AttachedTransformation()->ChannelPutModifiable2(channel, begin, length, m_passSignal ? messageEnd : 0, blocking);}
667 bool ChannelFlush(
const std::string &channel,
bool completeFlush,
int propagation=-1,
bool blocking=
true)
668 {
return m_passSignal ? m_owner.AttachedTransformation()->ChannelFlush(channel, completeFlush, propagation, blocking) :
false;}
670 {
return m_passSignal ? m_owner.AttachedTransformation()->ChannelMessageSeriesEnd(channel, propagation, blocking) :
false;}
683 bool IsolatedFlush(
bool hardFlush,
bool blocking);
685 void SetFilter(
Filter *filter);
686 void NextPutMultiple(
const byte *s,
size_t len);
687 void NextPutModifiable(byte *inString,
size_t length);
700 void FirstPut(
const byte *) {}
701 void LastPut(
const byte *,
size_t) {m_filter->
MessageEnd();}
728 typedef typename T::traits_type::char_type char_type;
731 : m_output(&output) {assert(
sizeof(output[0])==1);}
734 {
if (!parameters.
GetValue(
"OutputStringPointer", m_output))
throw InvalidArgument(
"StringSink: OutputStringPointer not specified");}
736 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
738 CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking);
741 typename T::size_type size = m_output->size();
742 if (length < size && size + length > m_output->capacity())
743 m_output->reserve(2*size);
744 m_output->append((
const char_type *)inString, (
const char_type *)inString+length);
768 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
779 : m_buf(NULL), m_size(0), m_total(0) {IsolatedInitialize(parameters);}
781 : m_buf(buf), m_size(size), m_total(0) {}
784 lword TotalPutLength() {
return m_total;}
787 byte * CreatePutSpace(
size_t &size);
788 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
803 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
822 CRYPTOPP_DLL
void StoreInitialize(
const NameValuePairs ¶meters);
825 size_t m_length, m_count;
833 : m_rng(NULL), m_length(0), m_count(0) {}
836 : m_rng(&rng), m_length(length), m_count(0) {}
844 CRYPTOPP_UNUSED(target); CRYPTOPP_UNUSED(begin); CRYPTOPP_UNUSED(end); CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(blocking);
845 throw NotImplemented(
"RandomNumberStore: CopyRangeTo2() is not supported by this store");
852 lword m_length, m_count;
859 NullStore(lword size = ULONG_MAX) : m_size(size) {}
861 {CRYPTOPP_UNUSED(parameters);}
889 lword Pump(lword pumpMax=
size_t(
SIZE_MAX))
890 {Pump2(pumpMax);
return pumpMax;}
891 unsigned int PumpMessages(
unsigned int count=UINT_MAX)
892 {PumpMessages2(count);
return count;}
895 virtual size_t Pump2(lword &byteCount,
bool blocking=
true) =0;
896 virtual size_t PumpMessages2(
unsigned int &messageCount,
bool blocking=
true) =0;
897 virtual size_t PumpAll2(
bool blocking=
true);
898 virtual bool SourceExhausted()
const =0;
902 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 907 void SourceInitialize(
bool pumpAll,
const NameValuePairs ¶meters)
909 IsolatedInitialize(parameters);
925 {m_store.IsolatedInitialize(parameters);}
926 size_t Pump2(lword &byteCount,
bool blocking=
true)
927 {
return m_store.TransferTo2(*AttachedTransformation(), byteCount,
DEFAULT_CHANNEL, blocking);}
928 size_t PumpMessages2(
unsigned int &messageCount,
bool blocking=
true)
929 {
return m_store.TransferMessagesTo2(*AttachedTransformation(), messageCount,
DEFAULT_CHANNEL, blocking);}
930 size_t PumpAll2(
bool blocking=
true)
931 {
return m_store.TransferAllTo2(*AttachedTransformation(),
DEFAULT_CHANNEL, blocking);}
932 bool SourceExhausted()
const 933 {
return !m_store.AnyRetrievable() && !m_store.AnyMessages();}
935 {m_store.SetAutoSignalPropagation(propagation);}
937 {
return m_store.GetAutoSignalPropagation();}
970 {SourceInitialize(pumpAll,
MakeParameters(
"RandomNumberGeneratorPointer", &rng)(
"RandomNumberStoreSize", length));}
975 #if CRYPTOPP_MSC_VERSION 976 # pragma warning(pop) used to pass byte array input as part of a NameValuePairs object
Base class for all exceptions thrown by Crypto++.
An invalid argument was detected.
StringSource(const char *string, bool pumpAll, BufferedTransformation *attachment=NULL)
zero terminated string as source
container of wait objects
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.
virtual BufferedTransformation * CreateDecryptionFilter(RandomNumberGenerator &rng, BufferedTransformation *attachment=NULL, const NameValuePairs ¶meters=g_nullNameValuePairs) const
create a new decryption filter
Implementation of BufferedTransformation's attachment interface.
std::string AlgorithmName() const
Provides the name of this algorithm.
Classes providing simple keying interfaces.
Utility functions for the Crypto++ library.
std::string AlgorithmName() const
Provides the name of this algorithm.
void SetAutoSignalPropagation(int propagation)
Set propagation of automatically generated and transferred signals.
Interface for one direction (encryption or decryption) of a stream cipher or block cipher mode with a...
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.
Interface for public-key signers.
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.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
Abstract base classes that provide a uniform interface to this library.
std::string AlgorithmName() const
Provides the name of this algorithm.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
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.
StringSource(const byte *string, size_t length, bool pumpAll, BufferedTransformation *attachment=NULL)
binary byte array as source
Interface for random number generators.
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.
SecByteBlock is a SecBlock<byte> typedef.
StringSource(const std::string &string, bool pumpAll, BufferedTransformation *attachment=NULL)
std::string as source
std::string AlgorithmName() const
Provides the name of this algorithm.
bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output on a channel.
virtual PK_MessageAccumulator * NewSignatureAccumulator(RandomNumberGenerator &rng) const =0
create a new HashTransformation to accumulate the message to be signed
byte * ChannelCreatePutSpace(const std::string &channel, size_t &size)
Request space which can be written into by the caller.
Classes and functions for secure memory allocations.
1 and 0's padding added to a block
Copy input to a memory buffer.
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.
bool GetValue(const char *name, T &value) const
Get a named value.
bool CanModifyInput() const
Determines whether input can be modifed by the callee.
Interface for public-key decryptors.
virtual BufferedTransformation * CreateEncryptionFilter(RandomNumberGenerator &rng, BufferedTransformation *attachment=NULL, const NameValuePairs ¶meters=g_nullNameValuePairs) const
Create a new encryption filter.
A method was called which was not implemented.
Filter Wrapper for HashTransformation.
Filter Wrapper for HashTransformation.
RNG-based implementation of Source interface.
Filter wrapper for decrypting with AuthenticatedSymmetricCipher, optionally handling padding/unpaddin...
void Detach(BufferedTransformation *newAttachment=NULL)
Replace an attached transformation.
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
Filter wrapper for encrypting with AuthenticatedSymmetricCipher, optionally handling padding/unpaddin...
std::string AlgorithmName() const
Provides the name of this algorithm.
simple 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.
StringSource ArraySource
use the third constructor for an array source
T1 SaturatingSubtract(const T1 &a, const T2 &b)
Performs a saturating subtract clamped at 0.
proxy for the filter created by PK_Decryptor::CreateDecryptionFilter
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
const NameValuePairs & g_nullNameValuePairs
An empty set of name-value pairs.
incorporates input into RNG as additional entropy
bool operator<(const ::PolynomialMod2 &a, const ::PolynomialMod2 &b)
compares degree
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
string-based implementation of Store interface
int GetAutoSignalPropagation() const
Retrieve automatic signal propagation value.
Redirect input to another BufferedTransformation without owning it.
bool AnyRetrievable() const
Determines whether bytes are ready for retrieval.
proxy for the filter created by PK_Encryptor::CreateEncryptionFilter
Behavior
Controls signal propagation behavior.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
Base class for unflushable filters.
Interface for public-key signature verifiers.
bool Attachable()
Determine if attachable.
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.
Implementation of BufferedTransformation's attachment interface.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
measure how many byte and messages pass through, also serves as valve
void GetWaitObjects(WaitObjectContainer &container, CallStack const &callStack)
Retrieves waitable objects.
No padding added to a block.
Crypto++ library namespace.
PKCS #5 padding added to a block.
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.
size_t PutModifiable2(byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes that may be modified by callee.
Ensures an object is not copyable.
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.
Provides interface for initialization of derived filters.
bool Flush(bool hardFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output, with signal propagation.
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.
Base class for bufferless filters.
#define SIZE_MAX
The maximum value of a machine word.
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.