Crypto++
8.2
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
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 4231 4275 4514)
75 bool Flush(
bool hardFlush,
int propagation=-1,
bool blocking=
true);
76 bool MessageSeriesEnd(
int propagation=-1,
bool blocking=
true);
80 void Insert(
Filter *nextFilter);
82 virtual bool ShouldPropagateMessageEnd()
const {
return true;}
83 virtual bool ShouldPropagateMessageSeriesEnd()
const {
return true;}
85 void PropagateInitialize(
const NameValuePairs ¶meters,
int propagation);
95 size_t Output(
int outputSite,
const byte *inString,
size_t length,
int messageEnd,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
105 size_t OutputModifiable(
int outputSite,
byte *inString,
size_t length,
int messageEnd,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
115 bool OutputMessageEnd(
int outputSite,
int propagation,
bool blocking,
const std::string &channel=
DEFAULT_CHANNEL);
134 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;
178 if (m_tempSpace.size() < minSize)
181 if (desiredSize >= minSize)
183 bufferSize = desiredSize;
186 m_tempSpace.New(bufferSize);
189 bufferSize = m_tempSpace.size();
190 return m_tempSpace.begin();
199 {
return HelpCreatePutSpace(target, channel, minSize, minSize, minSize);}
208 {
return HelpCreatePutSpace(target, channel, minSize, minSize, bufferSize);}
228 : m_transparent(transparent), m_currentMessageBytes(0), m_totalBytes(0)
229 , m_currentSeriesMessages(0), m_totalMessages(0), m_totalMessageSeries(0)
230 , m_begin(NULLPTR), m_length(0) {Detach(attachment); ResetMeter();}
243 void AddRangeToSkip(
unsigned int message, lword position, lword size,
bool sortNow =
true);
251 {CRYPTOPP_UNUSED(parameters); ResetMeter();}
253 lword GetCurrentMessageBytes()
const {
return m_currentMessageBytes;}
254 lword GetTotalBytes()
const {
return m_totalBytes;}
255 unsigned int GetCurrentSeriesMessages()
const {
return m_currentSeriesMessages;}
256 unsigned int GetTotalMessages()
const {
return m_totalMessages;}
257 unsigned int GetTotalMessageSeries()
const {
return m_totalMessageSeries;}
260 {
return AttachedTransformation()->CreatePutSpace(size);}
261 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
262 size_t PutModifiable2(
byte *inString,
size_t length,
int messageEnd,
bool blocking);
263 bool IsolatedMessageSeriesEnd(
bool blocking);
266 size_t PutMaybeModifiable(
byte *inString,
size_t length,
int messageEnd,
bool blocking,
bool modifiable);
267 bool ShouldPropagateMessageEnd()
const {
return m_transparent;}
268 bool ShouldPropagateMessageSeriesEnd()
const {
return m_transparent;}
272 inline bool operator<(
const MessageRange &b)
const
273 {
return message < b.message || (message == b.message && position < b.position);}
274 unsigned int message; lword position; lword size;
278 lword m_currentMessageBytes, m_totalBytes;
279 unsigned int m_currentSeriesMessages, m_totalMessages, m_totalMessageSeries;
280 std::deque<MessageRange> m_rangesToSkip;
329 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
331 return PutMaybeModifiable(
const_cast<byte *
>(inString), length, messageEnd, blocking,
false);
334 size_t PutModifiable2(
byte *inString,
size_t length,
int messageEnd,
bool blocking)
336 return PutMaybeModifiable(inString, length, messageEnd, blocking,
true);
352 virtual bool DidFirstPut()
const {
return m_firstInputDone;}
353 virtual size_t GetFirstPutSize()
const {
return m_firstSize;}
354 virtual size_t GetBlockPutSize()
const {
return m_blockSize;}
355 virtual size_t GetLastPutSize()
const {
return m_lastSize;}
357 virtual void InitializeDerivedAndReturnNewSizes(
const NameValuePairs ¶meters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize)
358 {CRYPTOPP_UNUSED(parameters); CRYPTOPP_UNUSED(firstSize); CRYPTOPP_UNUSED(blockSize); CRYPTOPP_UNUSED(lastSize); InitializeDerived(parameters);}
360 {CRYPTOPP_UNUSED(parameters);}
364 virtual void FirstPut(
const byte *inString) =0;
366 virtual void NextPutSingle(
const byte *inString)
370 virtual void NextPutMultiple(
const byte *inString,
size_t length);
372 virtual void NextPutModifiable(
byte *inString,
size_t length)
373 {NextPutMultiple(inString, length);}
384 virtual void LastPut(
const byte *inString,
size_t length) =0;
385 virtual void FlushDerived() {}
388 size_t PutMaybeModifiable(
byte *begin,
size_t length,
int messageEnd,
bool blocking,
bool modifiable);
389 void NextPutMaybeModifiable(
byte *inString,
size_t length,
bool modifiable)
391 if (modifiable) NextPutModifiable(inString, length);
392 else NextPutMultiple(inString, length);
397 virtual int NextPut(
const byte *inString,
size_t length)
398 {CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length);
CRYPTOPP_ASSERT(
false);
return 0;}
403 void ResetQueue(
size_t blockSize,
size_t maxBlocks);
405 byte *GetContigousBlocks(
size_t &numberOfBytes);
406 size_t GetAll(
byte *outString);
407 void Put(
const byte *inString,
size_t length);
408 size_t CurrentSize()
const {
return m_size;}
409 size_t MaxSize()
const {
return m_buffer.size();}
413 size_t m_blockSize, m_maxBlocks, m_size;
417 size_t m_firstSize, m_blockSize, m_lastSize;
418 bool m_firstInputDone;
435 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
440 m_inQueue.Put(inString, length);
443 IsolatedMessageEnd(blocking);
444 Output(0, NULLPTR, 0, messageEnd, blocking);
450 virtual bool IsolatedMessageEnd(
bool blocking) =0;
452 {CRYPTOPP_UNUSED(parameters); m_inQueue.Clear();}
532 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs ¶meters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
533 void FirstPut(
const byte *inString);
534 void NextPutMultiple(
const byte *inString,
size_t length);
535 void NextPutModifiable(
byte *inString,
size_t length);
536 void LastPut(
const byte *inString,
size_t length);
542 unsigned int m_mandatoryBlockSize;
543 unsigned int m_optimalBufferSize;
544 unsigned int m_reservedBufferSize;
566 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
567 byte *
CreatePutSpace(
size_t &size) {
return m_hashModule.CreateUpdateSpace(size);}
572 unsigned int m_digestSize;
574 std::string m_messagePutChannel, m_hashPutChannel;
589 :
Exception(DATA_INTEGRITY_CHECK_FAILED,
"HashVerificationFilter: message hash or MAC not valid") {}
609 DEFAULT_FLAGS = HASH_AT_BEGIN | PUT_RESULT
621 bool GetLastResult()
const {
return m_verified;}
624 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs ¶meters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
625 void FirstPut(
const byte *inString);
626 void NextPutMultiple(
const byte *inString,
size_t length);
627 void LastPut(
const byte *inString,
size_t length);
634 unsigned int m_digestSize;
662 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking);
674 void LastPut(
const byte *inString,
size_t length);
699 DEFAULT_FLAGS = THROW_EXCEPTION
717 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking);
718 bool GetLastResult()
const {
return m_hashVerifier.GetLastResult();}
721 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs ¶meters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
722 void FirstPut(
const byte *inString);
723 void NextPutMultiple(
const byte *inString,
size_t length);
735 void LastPut(
const byte *inString,
size_t length);
754 : m_rng(rng), m_signer(signer), m_messageAccumulator(signer.NewSignatureAccumulator(rng)), m_putMessage(putMessage) {Detach(attachment);}
759 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
780 :
Exception(DATA_INTEGRITY_CHECK_FAILED,
"VerifierFilter: digital signature not valid") {}
790 SIGNATURE_AT_BEGIN=1,
800 DEFAULT_FLAGS = SIGNATURE_AT_BEGIN | PUT_RESULT
818 void InitializeDerivedAndReturnNewSizes(
const NameValuePairs ¶meters,
size_t &firstSize,
size_t &blockSize,
size_t &lastSize);
819 void FirstPut(
const byte *inString);
820 void NextPutMultiple(
const byte *inString,
size_t length);
821 void LastPut(
const byte *inString,
size_t length);
845 PASS_WAIT_OBJECTS = 0x02,
848 PASS_EVERYTHING = PASS_SIGNALS | PASS_WAIT_OBJECTS
854 Redirector() : m_target(NULLPTR), m_behavior(PASS_EVERYTHING) {}
860 : m_target(&target), m_behavior(behavior) {}
868 Behavior GetBehavior() {
return static_cast<Behavior
>(m_behavior);}
869 void SetBehavior(Behavior behavior) {m_behavior=behavior;}
870 bool GetPassSignals()
const {
return (m_behavior & PASS_SIGNALS) != 0;}
871 void SetPassSignals(
bool pass) {
if (pass) m_behavior |= PASS_SIGNALS;
else m_behavior &= ~static_cast<word32>(PASS_SIGNALS); }
872 bool GetPassWaitObjects()
const {
return (m_behavior & PASS_WAIT_OBJECTS) != 0;}
873 void SetPassWaitObjects(
bool pass) {
if (pass) m_behavior |= PASS_WAIT_OBJECTS;
else m_behavior &= ~static_cast<word32>(PASS_WAIT_OBJECTS); }
876 {
return m_target ? m_target->CanModifyInput() :
false;}
882 return m_target->CreatePutSpace(size);
889 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
890 {
return m_target ? m_target->Put2(inString, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;}
891 bool Flush(
bool hardFlush,
int propagation=-1,
bool blocking=
true)
892 {
return m_target && GetPassSignals() ? m_target->Flush(hardFlush, propagation, blocking) :
false;}
894 {
return m_target && GetPassSignals() ? m_target->MessageSeriesEnd(propagation, blocking) :
false;}
899 return m_target->ChannelCreatePutSpace(channel, size);
906 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking)
907 {
return m_target ? m_target->ChannelPut2(channel, begin, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;}
909 {
return m_target ? m_target->ChannelPutModifiable2(channel, begin, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;}
910 bool ChannelFlush(
const std::string &channel,
bool completeFlush,
int propagation=-1,
bool blocking=
true)
911 {
return m_target && GetPassSignals() ? m_target->ChannelFlush(channel, completeFlush, propagation, blocking) :
false;}
913 {
return m_target && GetPassSignals() ? m_target->ChannelMessageSeriesEnd(channel, propagation, blocking) :
false;}
916 {
return m_target && GetPassWaitObjects() ? m_target->GetMaxWaitObjectCount() : 0; }
918 {
if (m_target && GetPassWaitObjects()) m_target->GetWaitObjects(container, callStack); }
946 {
return m_owner.AttachedTransformation()->CreatePutSpace(size);}
947 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
948 {
return m_owner.AttachedTransformation()->Put2(inString, length, m_passSignal ? messageEnd : 0, blocking);}
950 {
return m_owner.AttachedTransformation()->PutModifiable2(begin, length, m_passSignal ? messageEnd : 0, blocking);}
952 {
if (m_passSignal) m_owner.AttachedTransformation()->Initialize(parameters, propagation);}
953 bool Flush(
bool hardFlush,
int propagation=-1,
bool blocking=
true)
954 {
return m_passSignal ? m_owner.AttachedTransformation()->Flush(hardFlush, propagation, blocking) :
false;}
956 {
return m_passSignal ? m_owner.AttachedTransformation()->MessageSeriesEnd(propagation, blocking) :
false;}
959 {
return m_owner.AttachedTransformation()->ChannelCreatePutSpace(channel, size);}
960 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking)
961 {
return m_owner.AttachedTransformation()->ChannelPut2(channel, begin, length, m_passSignal ? messageEnd : 0, blocking);}
963 {
return m_owner.AttachedTransformation()->ChannelPutModifiable2(channel, begin, length, m_passSignal ? messageEnd : 0, blocking);}
964 bool ChannelFlush(
const std::string &channel,
bool completeFlush,
int propagation=-1,
bool blocking=
true)
965 {
return m_passSignal ? m_owner.AttachedTransformation()->ChannelFlush(channel, completeFlush, propagation, blocking) :
false;}
967 {
return m_passSignal ? m_owner.AttachedTransformation()->ChannelMessageSeriesEnd(channel, propagation, blocking) :
false;}
992 void SetFilter(
Filter *filter);
993 void NextPutMultiple(
const byte *s,
size_t len);
994 void NextPutModifiable(
byte *inString,
size_t length);
1011 void FirstPut(
const byte * inString)
1012 {CRYPTOPP_UNUSED(inString);}
1025 {CRYPTOPP_UNUSED(inString), CRYPTOPP_UNUSED(length); m_filter->MessageEnd();}
1066 typedef typename T::value_type value_type;
1075 {
if (!parameters.
GetValue(
"OutputStringPointer", m_output))
throw InvalidArgument(
"StringSink: OutputStringPointer not specified");}
1077 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
1079 CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking);
1082 typename T::size_type size = m_output->size();
1083 if (length < size && size + length > m_output->capacity())
1084 m_output->reserve(2*size);
1085 m_output->insert(m_output->end(), (
const value_type *)inString, (
const value_type *)inString+length);
1123 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
1145 : m_buf(NULLPTR), m_size(0), m_total(0) {IsolatedInitialize(parameters);}
1151 : m_buf(buf), m_size(size), m_total(0) {}
1162 byte * CreatePutSpace(
size_t &size);
1163 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
1189 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
1219 CRYPTOPP_DLL
void StoreInitialize(
const NameValuePairs ¶meters);
1221 const byte *m_store;
1222 size_t m_length, m_count;
1233 : m_rng(NULLPTR), m_length(0), m_count(0) {}
1236 : m_rng(&rng), m_length(length), m_count(0) {}
1244 CRYPTOPP_UNUSED(target); CRYPTOPP_UNUSED(begin); CRYPTOPP_UNUSED(end); CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(blocking);
1245 throw NotImplemented(
"RandomNumberStore: CopyRangeTo2() is not supported by this store");
1252 lword m_length, m_count;
1260 NullStore(lword size = ULONG_MAX) : m_size(size) {}
1262 {CRYPTOPP_UNUSED(parameters);}
1303 {Pump2(pumpMax);
return pumpMax;}
1310 {PumpMessages2(count);
return count;}
1329 virtual size_t Pump2(lword &byteCount,
bool blocking=
true) =0;
1335 virtual size_t PumpMessages2(
unsigned int &messageCount,
bool blocking=
true) =0;
1341 virtual size_t PumpAll2(
bool blocking=
true);
1345 virtual bool SourceExhausted()
const =0;
1350 void SourceInitialize(
bool pumpAll,
const NameValuePairs ¶meters)
1352 IsolatedInitialize(parameters);
1372 {m_store.IsolatedInitialize(parameters);}
1373 size_t Pump2(lword &byteCount,
bool blocking=
true)
1380 {
return !m_store.AnyRetrievable() && !m_store.AnyMessages();}
1382 {m_store.SetAutoSignalPropagation(propagation);}
1384 {
return m_store.GetAutoSignalPropagation();}
1454 {SourceInitialize(pumpAll,
MakeParameters(
"RandomNumberGeneratorPointer", &rng)(
"RandomNumberStoreSize", length));}
1459 #if CRYPTOPP_MSC_VERSION
1460 # pragma warning(pop)
void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1)
Initialize or reinitialize this object, with signal propagation.
@ W3C_PADDING
W3C padding added to a block.
@ PKCS_PADDING
PKCS padding added to a block.
@ ZEROS_PADDING
0's padding added to a block
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.
PK_DecryptorFilter(RandomNumberGenerator &rng, const PK_Decryptor &decryptor, BufferedTransformation *attachment=NULL)
Construct a PK_DecryptorFilter.
ArraySink(const NameValuePairs ¶meters=g_nullNameValuePairs)
Construct an ArraySink.
std::string AlgorithmName() const
Provides the name of this algorithm.
StringStore(const T &string)
Construct a StringStore.
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
Filter wrapper for PK_Signer.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
std::string AlgorithmName() const
Provides the name of this algorithm.
Create a working space in a BufferedTransformation.
byte * HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize)
Create a working space in a BufferedTransformation.
std::string AlgorithmName() const
Provides the name of this algorithm.
A method was called which was not implemented.
size_t Pump2(lword &byteCount, bool blocking=true)
Pump data to attached transformation.
void SetPassSignal(bool passSignal)
Set passSignal flag.
BlockPaddingScheme
Padding schemes used for block ciphers.
SecByteBlock m_tempSpace
Temporay working space.
Append input to a string object.
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.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
A non-transparent MeterFilter.
ArraySink(byte *buf, size_t size)
Construct an ArraySink.
StringSinkTemplate(T &output)
Construct a StringSinkTemplate.
StringSource(const byte *string, size_t length, bool pumpAll, BufferedTransformation *attachment=NULL)
Construct a StringSource.
Implementation of BufferedTransformation's attachment interface.
Data structure used to store byte strings.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
Filter class that is a proxy for a sink.
Xor input to a memory buffer.
String-based implementation of Store interface.
size_t PutModifiable2(byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes that may be modified by callee.
std::vector-based implementation of the Source interface
bool Attachable()
Determine if attachable.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
lword TotalPutLength()
Provides the number of bytes written to the Sink.
Classes and functions for secure memory allocations.
RandomNumberSink(RandomNumberGenerator &rng)
Construct a RandomNumberSink.
Append input to a string object.
Filter wrapper for PK_Decryptor.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
Proxy filter that doesn't modify the underlying filter's input or output.
MeterFilter(BufferedTransformation *attachment=NULL, bool transparent=true)
Construct a MeterFilter.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
A transparent MeterFilter.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.
VectorSource(const std::vector< byte > &vec, bool pumpAll, BufferedTransformation *attachment=NULL)
Construct a VectorSource.
Acts as a Source for pre-existing, static data.
Classes for automatic resource management.
StringSource(const std::string &string, bool pumpAll, BufferedTransformation *attachment=NULL)
Construct a StringSource.
Interface for public-key decryptors.
#define SIZE_MAX
The maximum value of a machine word.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
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.
unsigned int GetMaxWaitObjectCount() const
Retrieves the maximum number of waitable objects.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
Filter wrapper for HashTransformation.
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true)
Transfer bytes from this object to another BufferedTransformation.
Base class for Filter classes that are proxies for a chain of other filters.
Redirector(BufferedTransformation &target, Behavior behavior=PASS_EVERYTHING)
Construct a Redirector.
VectorSource(BufferedTransformation *attachment=NULL)
Construct a VectorSource.
TransparentFilter(BufferedTransformation *attachment=NULL)
Construct a TransparentFilter.
bool operator<(const OID &lhs, const OID &rhs)
Compare two OIDs for ordering.
@ DEFAULT_PADDING
Default padding scheme.
std::string AlgorithmName() const
Provides the name of this algorithm.
Filter wrapper for PK_Encryptor.
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.
StringSource(BufferedTransformation *attachment=NULL)
Construct a StringSource.
Exception thrown when a data integrity check failure is encountered.
Interface for custom flush signals.
Interface for random number generators.
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.
Classes providing basic library services.
Incorporates input into RNG as additional entropy.
size_t AvailableSize()
Provides the size remaining in the Sink.
Access a block of memory.
Interface for public-key signers.
bool AnyRetrievable() const
Determines whether bytes are ready for retrieval.
int GetAutoSignalPropagation() const
Retrieve automatic signal propagation value.
Base class for all exceptions thrown by the library.
Utility functions for the Crypto++ library.
void PumpAll()
Pump all data to attached transformation.
bool MessageSeriesEnd(int propagation=-1, bool blocking=true)
Marks the end of a series of messages, with signal propagation.
Implementation of BufferedTransformation's attachment interface.
unsigned int PumpMessages(unsigned int count=UINT_MAX)
Pump messages to attached transformation.
Padding schemes used for block ciphers.
Ensures an object is not copyable.
bool GetLastResult() const
Retrieves the result of the last verification.
Copy input to a memory buffer.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
byte * HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize, size_t desiredSize, size_t &bufferSize)
Create a working space in a BufferedTransformation.
Redirector()
Construct a Redirector.
RandomNumberSink()
Construct a RandomNumberSink.
void SetTransparent(bool transparent)
Set or change the transparent mode of this object.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
void SetAutoSignalPropagation(int propagation)
Set propagation of automatically generated and transferred signals.
bool SourceExhausted() const
Determines if the Source is exhausted.
SignerFilter(RandomNumberGenerator &rng, const PK_Signer &signer, BufferedTransformation *attachment=NULL, bool putMessage=false)
Construct a SignerFilter.
bool CanModifyInput() const
Determines whether input can be modified by the callee.
Filter wrapper for HashTransformation.
byte * ChannelCreatePutSpace(const std::string &channel, size_t &size)
Request space which can be written into by the caller.
Base class for unflushable filters.
Classes for an unlimited queue to store bytes.
void Detach(BufferedTransformation *newAttachment=NULL)
Replace an attached transformation.
RNG-based implementation of Source interface.
Source(BufferedTransformation *attachment=NULL)
Construct a Source.
bool Flush(bool hardFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output, with signal propagation.
OpaqueFilter(BufferedTransformation *attachment=NULL)
Construct an OpaqueFilter.
bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output on a channel.
StringStore(const byte *string, size_t length)
Construct a StringStore.
size_t PumpAll2(bool blocking=true)
Pump all data to attached transformation.
Append input to a std::vector<byte> object.
Base class for bufferless filters.
@ NO_PADDING
No padding added to a block.
void StopRedirection()
Stop redirecting input.
Flags
Flags controlling filter behavior.
bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true)
Marks the end of a series of messages on a channel.
An invalid argument was detected.
Exception thrown when an invalid signature is encountered.
Flags
Flags controlling filter behavior.
Pointer-based implementation of the Source interface.
Behavior
Controls signal propagation behavior.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
byte * HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize, size_t bufferSize)
Create a working space in a BufferedTransformation.
Interface for public-key signature verifiers.
OutputProxy(BufferedTransformation &owner, bool passSignal)
Construct an OutputProxy.
const NameValuePairs & g_nullNameValuePairs
An empty set of name-value pairs.
BufferedTransformation * AttachedTransformation()
Retrieve attached transformation.
PK_EncryptorFilter(RandomNumberGenerator &rng, const PK_Encryptor &encryptor, BufferedTransformation *attachment=NULL)
Construct a PK_EncryptorFilter.
ArrayXorSink(byte *buf, size_t size)
Construct an ArrayXorSink.
Crypto++ library namespace.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
bool GetValue(const char *name, T &value) const
Get a named value.
Flags
Flags controlling filter behavior.
bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output on a channel.
T1 SaturatingSubtract(const T1 &a, const T2 &b)
Performs a saturating subtract clamped at 0.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
void Redirect(BufferedTransformation &target)
Redirect input to another BufferedTransformation.
byte * ChannelCreatePutSpace(const std::string &channel, size_t &size)
Request space which can be written into by the caller.
bool Flush(bool hardFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output, with signal propagation.
@ ONE_AND_ZEROS_PADDING
1 and 0's padding added to a block
Filter wrapper for decrypting with AuthenticatedSymmetricCipher.
Transform a Store into a Source.
void LastPut(const byte *inString, size_t length)
Input the last block of data.
virtual void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1)=0
Initialize or reinitialize this object, with signal propagation.
Filter wrapper for PK_Verifier.
bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true)
Marks the end of a series of messages on a channel.
Filter wrapper for encrypting with AuthenticatedSymmetricCipher.
StringSource(const char *string, bool pumpAll, BufferedTransformation *attachment=NULL)
Construct a StringSource.
std::string AlgorithmName() const
Provides the name of this algorithm.
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.
lword Pump(lword pumpMax=...)
Pump data to attached transformation.
size_t PumpMessages2(unsigned int &messageCount, bool blocking=true)
Pump messages to attached transformation.
String-based implementation of the Source interface.
Interface for retrieving values given their names.
Abstract base classes that provide a uniform interface to this library.
bool MessageSeriesEnd(int propagation=-1, bool blocking=true)
Marks the end of a series of messages, with signal propagation.
bool GetPassSignal() const
Retrieve passSignal flag.
Used to pass byte array input as part of a NameValuePairs object.
Redirect input to another BufferedTransformation without owning it.
Classes for working with NameValuePairs.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
SimpleProxyFilter(BufferedTransformation *filter, BufferedTransformation *attachment)
Construct a SimpleProxyFilter.
Measure how many bytes and messages pass through the filter.
void GetWaitObjects(WaitObjectContainer &container, CallStack const &callStack)
Retrieves waitable objects.
StringStore(const char *string=NULL)
Construct a StringStore.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
RNG-based implementation of Source interface.
Interface for authenticated encryption modes of operation.