On Sunday, April 5, 2015 at 11:20:16 PM UTC-4, Maricel Gregoraschko wrote:

> By the way, you are linking to wiki pages (Authenticated_Encryption, 
> ChannelSwitch), that I see no way to get to from cryptopp main wiki page
> http://www.cryptopp.com/wiki/Main_Page - private 
> <http://www.cryptopp.com/wiki/Main_Page>
>
Well, we (the community) run the Wiki. What do you suggest? We can make the 
changes if they seem like they would be helpful.
 

> I had no clue they existed, and it seems there are many more. I see no 
> table of contents, no index and no search, how does one get to the 
> documentation without knowing exact URL's of specific pages?
>
Yeah, once you know about the wiki and begin searching it, it gets a lot 
easier :)

Take consolation in the fact that the wiki has only been around since about 
2005 or so. It was quite painful before then :)

The source code is incredibly sparsely documented, is there annotated code 
> elsewhere? Am I looking in the wrong place?
>
Yes. On the Crypto++ homepage, see the link to "Manual" at the top. That's 
the Doxygen markup for the annotated sources. But they are brief too.
 

> How is one supposed to know what putMessage=true means in HashFilter()?
>
http://www.cryptopp.com/wiki/HashFilter
 

> Or the fact that HashVerificationFilter() takes in the message + hash at 
> the end if you use HashVerificationFilter::HASH_AT_END and it outputs just 
> the message with the hash stripped if you use 
> HashVerificationFilter::PUT_MESSAGE?
>
http://www.cryptopp.com/wiki/HashVerificationFilter
 

> Or the fact that ChannelSwitch exists and what it's used for? People just 
> browse through source code, look at classes and go "there it is! that's 
> what I'm looking for!"? :)
>
http://www.cryptopp.com/wiki/ChannelSwitch
 

> One more question, how does HashVerificationFilter check the hash, does it 
> set a status somewhere? Because it doesn't throw an exception or anything 
> for the wrong hash.
> Thank you very much for your time. It's truly appreciated.
>
OK, you can use PUT_RESULT here.

Or, you can tell the filter to throw with THROW_EXCEPTION. The example 
below should probably use THROW_EXCEPTION.

I don't believe you can use both PUT_RESULT and  THROW_EXCEPTION because 
there's only one sink. You have to sue the sink to recover the message, or 
use the sink to capture the result (true/false).

I think there's another way to jigger it with a Redirector:

    // Authenticate and decrypt data
    HashVerificationFilter hvf(hmac2,
                       new StreamTransformationFilter(decryptor,
                                                      new 
StringSink(recover)),
                       HASH_AT_END | PUT_MESSAGE);

    StringSource ss2(cipher, true /*pumpAll*/, new Redirector(hvf));

    if(!hvf.GetLastResult()) {
        cerr << "Failed to verify message" << endl;
        exit(1);
    }

And of course, Redirector is documented at 
http://www.cryptopp.com/wiki/Redirector.

Jeff

>  

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to