This worked for all the public key signature algs I tried, not just RSA.

I created a trivial subclass of CryptoPP::HashTransformation that
allows you to set a pre-calculated digest and length. It should use
this value when TruncatedFinal() andTruncatedVerify() are called.

So then create a PK_Signer. Instantiate a
CryptoPP::PK_MessageAccumulatorImpl<YourSubclass> and populate the
pre-calculated digest. Then you'll be able to call Sign() with your
accumulator.

For DL-based signature schemes there was a bit more work to do but not much.

I'd be curious to hear a simpler way to accomplish this, if anyone has
one... this was a little painful :)

Geoff

On 5/29/07, rst <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I use the RSASSA_PKCS1v15_SHA_Signer to hash and sign a message with
> this signature scheme like in the following sample and its working
> fine.
>
> CryptoPP::RSASSA_PKCS1v15_SHA_Signer mysign(PrivKey);
> CryptoPP::PK_MessageAccumulator *pSigMsgAcc =
> mysign.NewSignatureAccumulator(rnd);
> pSigMsgAcc->Update(message, sizeof(message));
> mysign.Sign(rnd, pSigMsgAcc, sigdata);
>
> The problem is that i want to skip the SHA hash calculation and move
> directly to the signature with a precalculated SHA hash.
>
> Anyone an idea how to to this?
> Any help would be welcome and appreciated!
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---

Reply via email to