#include <cryptlib.h>
Inheritance diagram for BufferedTransformation:

ERRORS | |
| enum | ErrorType { CANNOT_FLUSH, DATA_INTEGRITY_CHECK_FAILED, INVALID_DATA_FORMAT, INPUT_ERROR, OUTPUT_ERROR, OTHER_ERROR } |
| error types. More... | |
INPUT | |
| virtual void | Put (byte inByte)=0 |
| input a byte for processing. More... | |
| virtual void | Put (const byte *inString,unsigned int length)=0 |
| input multiple bytes. More... | |
| void | PutWord16 (word16 value,bool highFirst=true) |
| input a 16-bit word, big-endian or little-endian depending on highFirst. More... | |
| void | PutWord32 (word32 value,bool highFirst=true) |
| input a 32-bit word. More... | |
SIGNALS | |
| virtual void | Flush (bool completeFlush,int propagation=-1) |
| process everything in internal buffers and output them. More... | |
| virtual void | MessageEnd (int propagation=-1) |
| mark end of an input segment, message, or packet. More... | |
| virtual void | PutMessageEnd (const byte *inString,unsigned int length,int propagation=-1) |
| same as Put() followed by MessageEnd() but may be more efficient. More... | |
| virtual void | MessageSeriesEnd (int propagation=-1) |
| mark end of a series of messages. More... | |
| virtual void | SetAutoSignalPropagation (int propagation) |
| set propagation of automatically generated and transfered signals. More... | |
| virtual int | GetAutoSignalPropagation ()const |
| void | Close () |
RETRIEVAL OF ONE MESSAGE | |
| virtual unsigned long | MaxRetrievable ()const |
| returns number of bytes that is currently ready for retrieval. More... | |
| unsigned long | MaxRetrieveable ()const |
| virtual bool | AnyRetrievable ()const |
| returns whether any bytes are currently ready for retrieval. More... | |
| virtual unsigned int | Get (byte &outByte) |
| try to retrieve a single byte. More... | |
| virtual unsigned int | Get (byte *outString,unsigned int getMax) |
| try to retrieve multiple bytes. More... | |
| virtual unsigned int | Peek (byte &outByte)const |
| peek at the next byte without removing it from the output buffer. More... | |
| virtual unsigned int | Peek (byte *outString,unsigned int peekMax)const |
| peek at multiple bytes without removing them from the output buffer. More... | |
| unsigned int | GetWord16 (word16 &value,bool highFirst=true) |
| try to retrieve a 16-bit word, big-endian or little-endian depending on highFirst. More... | |
| unsigned int | GetWord32 (word32 &value,bool highFirst=true) |
| try to retrieve a 32-bit word. More... | |
| unsigned int | PeekWord16 (word16 &value,bool highFirst=true) |
| try to peek at a 16-bit word, big-endian or little-endian depending on highFirst. More... | |
| unsigned int | PeekWord32 (word32 &value,bool highFirst=true) |
| try to peek at a 32-bit word. More... | |
| virtual unsigned long | TransferTo (BufferedTransformation &target,unsigned long transferMax=ULONG_MAX) |
| move transferMax bytes of the buffered output to target as input. More... | |
| virtual unsigned long | Skip (unsigned long skipMax=ULONG_MAX) |
| discard skipMax bytes from the output buffer. More... | |
| virtual unsigned long | CopyTo (BufferedTransformation &target,unsigned long copyMax=ULONG_MAX)const |
| copy copyMax bytes of the buffered output to target as input. More... | |
RETRIEVAL OF MULTIPLE MESSAGES | |
| virtual unsigned long | TotalBytesRetrievable ()const |
| virtual unsigned int | NumberOfMessages ()const |
| number of times MessageEnd() has been received minus messages retrieved or skipped. More... | |
| virtual bool | AnyMessages ()const |
| returns true if NumberOfMessages() > 0. More... | |
| virtual bool | GetNextMessage () |
| start retrieving the next message. More... | |
| virtual unsigned int | SkipMessages (unsigned int count=UINT_MAX) |
| skip count number of messages. More... | |
| virtual unsigned int | TransferMessagesTo (BufferedTransformation &target,unsigned int count=UINT_MAX) |
| virtual unsigned int | CopyMessagesTo (BufferedTransformation &target,unsigned int count=UINT_MAX)const |
| virtual void | SkipAll () |
| virtual void | TransferAllTo (BufferedTransformation &target) |
| virtual void | CopyAllTo (BufferedTransformation &target)const |
CHANNELS | |
| virtual void | ChannelPut (const::string &channel,byte inByte) |
| virtual void | ChannelPut (const::string &channel,const byte *inString,unsigned int length) |
| void | ChannelPutWord16 (const::string &channel,word16 value,bool highFirst=true) |
| void | ChannelPutWord32 (const::string &channel,word32 value,bool highFirst=true) |
| virtual void | ChannelFlush (const::string &channel,bool completeFlush,int propagation=-1) |
| virtual void | ChannelMessageEnd (const::string &channel,int propagation=-1) |
| virtual void | ChannelPutMessageEnd (const::string &channel,const byte *inString,unsigned int length,int propagation=-1) |
| virtual void | ChannelMessageSeriesEnd (const::string &channel,int propagation=-1) |
| virtual void | SetRetrievalChannel (const::string &channel) |
| const ::string | NULL_CHANNEL |
ATTACHMENT | |
| Some BufferedTransformation objects (e.g. Filter objects) allow other BufferedTransformation objects to be attached. When this is done, the first object instead of buffering its output, sents that output to the attached object as input. The entire attachment chain is deleted when the anchor object is destructed. | |
| virtual bool | Attachable () |
| returns whether this object allows attachment. More... | |
| virtual BufferedTransformation* | AttachedTransformation () |
| returns the object immediately attached to this object or NULL for no attachment. More... | |
| virtual const BufferedTransformation* | AttachedTransformation ()const |
| virtual void | Detach (BufferedTransformation *newAttachment=0) |
| delete the current attachment chain and replace it with newAttachment. More... | |
| virtual void | Attach (BufferedTransformation *newAttachment) |
| add newAttachment to the end of attachment chain. More... | |
Public Methods | |
| virtual | ~BufferedTransformation () |
BufferedTransformation is a generalization of BlockTransformation, StreamCipher, and HashModule.
A buffered transformation is an object that takes a stream of bytes as input (this may be done in stages), does some computation on them, and then places the result into an internal buffer for later retrieval. Any partial result already in the output buffer is not modified by further input.
Computation is generally done as soon as possible, but some buffering on the input may be done for performance reasons.
Definition at line 264 of file cryptlib.h.
|
|
error types.
Definition at line 315 of file cryptlib.h. |
|
|
Definition at line 268 of file cryptlib.h. |
|
|
returns true if NumberOfMessages() > 0.
Definition at line 261 of file cryptlib.cpp. |
|
|
returns whether any bytes are currently ready for retrieval.
Reimplemented in MessageQueue, and ByteQueue. Definition at line 172 of file cryptlib.cpp. Referenced by Store::GetNextMessage(). |
|
|
add newAttachment to the end of attachment chain.
Definition at line 436 of file cryptlib.cpp. |
|
|
returns whether this object allows attachment.
Reimplemented in Filter. Definition at line 442 of file cryptlib.h. Referenced by Attach(). |
|
|
Definition at line 446 of file cryptlib.h. |
|
|
returns the object immediately attached to this object or NULL for no attachment.
Reimplemented in Filter. Definition at line 444 of file cryptlib.h. Referenced by AnyMessages(), AnyRetrievable(), Attach(), CopyTo(), Flush(), NetworkSource::GeneralPump(), Get(), GetNextMessage(), MaxRetrievable(), MessageEnd(), MessageSeriesEnd(), NumberOfMessages(), Peek(), StreamCipherFilter::Put(), TransparentFilter::Put(), Put(), Skip(), SkipMessages(), and TransferTo(). |
|
|
Definition at line 129 of file cryptlib.cpp. |
|
|
Definition at line 137 of file cryptlib.cpp. |
|
|
Definition at line 145 of file cryptlib.cpp. |
|
|
Definition at line 356 of file cryptlib.cpp. |
|
|
Definition at line 350 of file cryptlib.cpp. |
|
|
Definition at line 153 of file cryptlib.cpp. |
|
|
Definition at line 362 of file cryptlib.cpp. |
|
|
Definition at line 376 of file cryptlib.cpp. |
|
|
Definition at line 309 of file cryptlib.h. |
|
|
Definition at line 333 of file cryptlib.cpp. |
|
|
Definition at line 303 of file cryptlib.cpp. |
|
|
copy copyMax bytes of the buffered output to target as input.
Reimplemented in BERGeneralDecoder, FileStore, Store, StringStore, RandomNumberStore, MessageQueue, and ByteQueue. Definition at line 229 of file cryptlib.cpp. Referenced by BERGeneralDecoder::CopyTo(), MaxRetrievable(), and Peek(). |
|
|
delete the current attachment chain and replace it with newAttachment.
Reimplemented in Filter. Definition at line 449 of file cryptlib.h. Referenced by Attach(). |
|
|
process everything in internal buffers and output them. throws exception if completeFlush == true and it's not possible to flush everything Reimplemented in ChannelSwitch, FileSink, Redirector, ProxyFilter, NonblockingSink, Deflator, and Inflator. Definition at line 105 of file cryptlib.cpp. Referenced by Inflator::Flush(), Deflator::Flush(), Redirector::Flush(), and ProxyFilter::Flush(). |
|
|
try to retrieve multiple bytes.
Reimplemented in ByteQueue. Definition at line 191 of file cryptlib.cpp. |
|
|
try to retrieve a single byte.
Reimplemented in ByteQueue. Definition at line 183 of file cryptlib.cpp. Referenced by Get(). |
|
|
Definition at line 306 of file cryptlib.h. |
|
|
start retrieving the next message. Returns false if no more messages exist or this message is not completely retrieved. Reimplemented in Store. Definition at line 269 of file cryptlib.cpp. |
|
|
try to retrieve a 16-bit word, big-endian or little-endian depending on highFirst.
Definition at line 426 of file cryptlib.cpp. Referenced by BERGeneralDecoder::MessageEnd(). |
|
|
try to retrieve a 32-bit word.
Definition at line 431 of file cryptlib.cpp. |
|
|
returns number of bytes that is currently ready for retrieval. All retrieval functions return the actual number of bytes retrieved, which is the lesser of the request number and MaxRetrievable(). Reimplemented in FileStore, MessageQueue, and ByteQueue. Definition at line 164 of file cryptlib.cpp. Referenced by MessageQueue::CopyTo(), and MessageQueue::TransferTo(). |
|
|
Definition at line 351 of file cryptlib.h. |
|
|
mark end of an input segment, message, or packet. propagation != 0 means pass on the signal to attached BufferedTransformation objects, with propagation decremented at each step until it reaches 0. -1 means unlimited propagation. Reimplemented in BERGeneralDecoder, DERGeneralEncoder, Base64Encoder, Base64Decoder, ChannelSwitch, FileSink, FilterWithBufferedInput, HashFilter, SignerFilter, VerifierFilter, Redirector, Source, HexDecoder, SecretSharing, InformationDispersal, MessageQueue, NetworkSink, WAKEEncryption, WAKEDecryption, Deflator, and Inflator. Definition at line 111 of file cryptlib.cpp. Referenced by Inflator::MessageEnd(), Deflator::MessageEnd(), WAKEDecryption::MessageEnd(), WAKEEncryption::MessageEnd(), HexDecoder::MessageEnd(), Redirector::MessageEnd(), VerifierFilter::MessageEnd(), SignerFilter::MessageEnd(), HashFilter::MessageEnd(), FilterWithBufferedInput::MessageEnd(), Base64Decoder::MessageEnd(), Base64Encoder::MessageEnd(), and PutMessageEnd(). |
|
|
mark end of a series of messages. There should be a MessageEnd immediately before MessageSeriesEnd. Reimplemented in ChannelSwitch, and Redirector. Definition at line 117 of file cryptlib.cpp. Referenced by Redirector::MessageSeriesEnd(). |
|
|
number of times MessageEnd() has been received minus messages retrieved or skipped.
Reimplemented in Store, and MessageQueue. Definition at line 253 of file cryptlib.cpp. Referenced by AnyMessages(). |
|
|
peek at multiple bytes without removing them from the output buffer.
Reimplemented in ByteQueue. Definition at line 210 of file cryptlib.cpp. |
|
|
peek at the next byte without removing it from the output buffer.
Reimplemented in FileStore, and ByteQueue. Definition at line 202 of file cryptlib.cpp. Referenced by AnyRetrievable(), Peek(), PeekWord16(), and PeekWord32(). |
|
|
try to peek at a 16-bit word, big-endian or little-endian depending on highFirst.
Definition at line 400 of file cryptlib.cpp. Referenced by GetWord16(). |
|
|
try to peek at a 32-bit word.
Definition at line 413 of file cryptlib.cpp. Referenced by GetWord32(). |
|
|
input multiple bytes.
Reimplemented in Base64Encoder, Base64Decoder, ChannelSwitch, FileSink, TransparentFilter, OpaqueFilter, FilterWithBufferedInput, FilterWithInputQueue, StreamCipherFilter, HashFilter, SignerFilter, VerifierFilter, BitBucket, Redirector, StringSinkTemplate, ArraySink, ArrayXorSink, Store, Source, HexEncoder, HexDecoder, RawIDA, SecretSharing, InformationDispersal, MessageQueue, NetworkSink, ByteQueue, RandomPool, MaurerRandomnessTest, WAKEEncryption, Deflator, and Inflator. Definition at line 99 of file cryptlib.cpp. |
|
|
input a byte for processing.
Reimplemented in Base64Encoder, Base64Decoder, ChannelSwitch, FileSink, TransparentFilter, OpaqueFilter, FilterWithBufferedInput, FilterWithInputQueue, StreamCipherFilter, HashFilter, SignerFilter, VerifierFilter, BitBucket, Redirector, StringSinkTemplate, ArraySink, ArrayXorSink, Store, Source, HexEncoder, HexDecoder, RawIDA, SecretSharing, InformationDispersal, MessageQueue, NetworkSink, ByteQueue, RandomPool, MaurerRandomnessTest, WAKEEncryption, Deflator, and Inflator. Definition at line 93 of file cryptlib.cpp. Referenced by ByteQueue::CopyTo(), RandomNumberStore::CopyTo(), StringStore::CopyTo(), DERGeneralEncoder::MessageEnd(), Inflator::Put(), Deflator::Put(), NetworkSink::Put(), InformationDispersal::Put(), SecretSharing::Put(), Redirector::Put(), Put(), PutMessageEnd(), ByteQueue::TransferTo(), and FileStore::TransferTo(). |
|
|
same as Put() followed by MessageEnd() but may be more efficient.
Reimplemented in ChannelSwitch. Definition at line 123 of file cryptlib.cpp. |
|
|
input a 16-bit word, big-endian or little-endian depending on highFirst.
Definition at line 390 of file cryptlib.cpp. Referenced by Integer::OpenPGPEncode(). |
|
|
input a 32-bit word.
Definition at line 395 of file cryptlib.cpp. |
|
|
set propagation of automatically generated and transfered signals. propagation == 0 means do not automaticly generate signals Reimplemented in BufferedTransformationWithAutoSignal. Definition at line 303 of file cryptlib.h. |
|
|
Definition at line 344 of file cryptlib.cpp. |
|
|
discard skipMax bytes from the output buffer.
Reimplemented in ByteQueue. Definition at line 221 of file cryptlib.cpp. |
|
|
Definition at line 311 of file cryptlib.cpp. |
|
|
skip count number of messages.
Definition at line 277 of file cryptlib.cpp. |
|
|
Definition at line 245 of file cryptlib.cpp. |
|
|
Definition at line 322 of file cryptlib.cpp. |
|
|
Definition at line 285 of file cryptlib.cpp. |
|
|
move transferMax bytes of the buffered output to target as input.
Reimplemented in BERGeneralDecoder, FileStore, Store, StringStore, RandomNumberStore, MessageQueue, and ByteQueue. Definition at line 237 of file cryptlib.cpp. Referenced by Get(), Skip(), and BERGeneralDecoder::TransferTo(). |
|
|
Definition at line 430 of file cryptlib.h. |
1.2.4 written by Dimitri van Heesch,
© 1997-2000