Hi Jeff, that is where I got my code base from, then modified it a
little, because I get the DomainParameters from a file.

Still it is unclear to me the following:
-can I use:
  DH dh(StringSource(GivenDHDomainParameters,
            GivenDHDomainParametersLength,
            true,
            NULL));
-can the given public key be as bytes (integer without the zeroes) or
does it have to be DER with the SEQUENCE?
-why does my code posted before works only if I use the dhTemp (read
my second thread)

Thanks.
Christian



On Sep 14, 5:24 pm, "Jeffrey Walton" <[EMAIL PROTECTED]> wrote:
> Hi Christian,
>
> Have you looked at the sample on the 
> Wiki?http://www.cryptopp.com/wiki/Diffie-Hellman_Key_Exchange.
>
> Jeff
>
> On 9/14/07, greatx <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I believe the function dh.Agree(...) is NOT expecting the given public
> > key to be in DER encoding, or is it?
> > I have tried putting the given public key with the SEQUENCE in the
> > begining of it, but the Agree() returned 0.
> > If I put the given public key after stripping the un-used zero bytes,
> > then the Agree() returns 1.
>
> > Please also note my question about this:
> > ---------------------------------------------------
> > // Initiate DH with the given Domain Parameters
> > DH dh(StringSource(GivenDHDomainParameters,
> > GivenDHDomainParametersLength, true, NULL));
> > // This here is the difference on the code: basically I had to create
> > a dhTemp and pass the prime and generator... why???
> > Integer iPrime = dh.GetGroupParameters().GetModulus();
> > Integer iGenerator = dh.GetGroupParameters().GetSubgroupGenerator();
> > DH dhTemp(iPrime, iGenerator);
> > ----------------------------------------------------
>
> > Christian- Hide quoted text -
>
> - Show quoted text -


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