I have a filter which is last in the chain _before_ the sink. The
filter needs a single buffer to perform some work on the message. The
buffer will then be an argument to Put().
// cryptlib.h
virtual byte * CreatePutSpace(size_t &size) {size=0; return NULL;}
Any ideas on what I should be using?
Jeff
CreatePutSpace() is implemented by Filters that happen to have an existing
allocated buffer that can be reused. The caller has to be prepared for the
possibility that it will return NULL and fall back to using its own
SecByteBlock in that case. There's a helper class FilterPutSpaceHelper that
does this for you. Or you can not worry about saving the memory allocations
and copies and just use a SecByteBlock directly, like you've done.
> Wei: any corrections or omissions would be appreciated.
In IsolatedFlush(), you're not supposed to call IsolatedFlush() on the
AttachedTransformation(). This will be done by Filter's implementation of
Flush().
You should probably warn the Wiki reader that the interfaces used to
implement a Filter may not be as stable as the interfaces that are meant to
be used by applications. The basic Put() and Get() for example are backwards
compatible to early versions of Crypto++, while Put2() and IsolatedFlush()
were introduced in version 5.0, I think.
Thanks. The topics have been revised.
Jeff