
Thanks for suggestion. My crypt_something class meant to be streamed but i failed to describe it. crypt_something is buffered 'processor' and user can call process() several time example: crypt_something cs; cs.init(encryption_key); ... while (!input_stream.eof()) { in_buffer = input_stream.read(); //reading to buffer from input stream size_t outsize = cs.process_outsize(in_buffer.begin(), in_buffer.end()); //determining //amount of memory we will need to write output if (out_buffer.size() < outsize) out_buffer.resize(outsize); stream_buffer::iterator it = cs.process(in_buffer.begin(), in_buffer.end(), out_buffer.begin()); out_stream.write(out_buffer.begin(), it); } //flushing buffer size_t outsize = cs.flush_outsize<stream_buffer::item_type>(); if (out_buffer.size() < outsize) out_buffer.resize(outsize); stream_buffer::iterator it = cs.flush(out_buffer.begin()); out_stream.write(out_buffer.begin(), it); It is written in some kind of pseudo-code but i hope it is clear enough now :) Sergey. On 3/23/07, Ames Andreas <Andreas.Ames@comergo.com> wrote:
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Sergey Sent: Thursday, March 22, 2007 11:10 PM To: boost@lists.boost.org Subject: [boost] Cryptographic library for Boost
template<class iIt, class oIt> oIt process(iIt begin, iIt end, oIt out);
Criticism is welcomed :)
No criticism, just a thought/suggestion:
As it stands, 'process' is linear.