On Tuesday, July 16, 2013 4:54:06 PM UTC-4, Jeffrey Walton wrote:
>
>
>
> On Wednesday, July 10, 2013 6:08:06 PM UTC-4, Steven wrote:
>>
>> I'm using df.put(...  and df.get(...  on large files, even though the 
>> file is 
>> successfully decrypted, I get no exceptions to tell me why authentication 
>> is 
>> failing. Is there an alternative method to verify authentication when not 
>> using Channels?   
>>
> You have to attach an ArraySink, use PUT_RESULT, and finally call 
> MessageEnd(). Upon receiving MessageEnd(), the filter will put the result 
> of the authentication in the ArraySink. Something like:
>
>
>     GCM< AES >::Decryption decrypter;
>     decrypter.SetKeyWithIV( key, sizeof(key), iv, sizeof(iv) );
>     ...
>
>     bool result = false;
>     AuthenticatedDecryptionFilter df( decrypter,
>          new ArraySink(&result, sizeof(result)),
>          PUT_MESSAGE | MAC_AT_END );
>
Part of that was incorrect. If you PUT_RESULT, then it muddies the waters 
with PUT_MESSAGE.

After inserting all data into the filter, call MessageEnd() to get it 
processed and then call:

    bool verified = df.GetLastResult();
    assert(verified == true);

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/groups/opt_out.


Reply via email to