Mark,

I only gave your code a short glance, and I don't remember how cryptarc
is written any more, so... your wrap-around might possibly work, or then
again it might not. It's possible that there are further
incompatibilities within the original implementation of Put() and
MessageEnd(), and that a superficial wrapper won't suffice.

Otherwise, your interpretation looks fine except for the "if (blocking)"
part - prior to Crypto++ 5, non-blocking I/O was not supported, so you
should check the blocking parameter at the beginning of Put2() and throw
BlockingInputOnly if 'blocking' is false.

If you want to learn how to implement non-blocking input, study
filters.h, filters.cpp, and fltrimpl.h.

denis


-----Original Message-----
From: Mark Simonton
Sent: Sunday, April 06, 2003 01:17
To: [EMAIL PROTECTED]
Subject: Put2 clarifacation request


Situation: I am using Crypto++ 5.0 and creating an app similar to
cryptarc, in
fact I am using cryptarc as a pattern, I am not using the BSL stuff
because I
could not find it to download.

Needless to say the classes in cryptarc are written for 4.2 version of
the lib
and they do not conform to the current requirements, specificaly they do
not
support Put2().

I have traced through the code quite a bit to find that (I think) PUt2
seems
to be acting like a trafic cop based on the contents of the data and the
messageEnd flag.

My minimal version of Put2 looks like this

int foo::Put2( byte* inString, int count, int messageEnd, int blocking)
{
    Put( inString, count );
    if (messageEnd) {
        MessageEnd();   // this will propigate to
AttachedTransformation() 
                        // if any 
    }
    if(blocking) {
        // do I need to do anything here?
    }
    return 0;
}

This seems to work but it seems simplistic, compaired to say what
happens in
BufferedTransformation.  Are my interpretations correct?

Thanks.

[Mark]
========
[Mark]


Reply via email to