I don't really understand the math very well.  I assume that being a
generator has something to do with ensuring that a^b%n has a long period as n
increases.

        Is the check for a generator actually useless, or just unnecessarily
strict?  Because in the second case (assuming my code doesn't have any nasty
bugs), it would allow support for other generators rather than leaving those
people with a possibly unsafe g.

                                                -J

On Tue, 19 Mar 2002, Bodo Moeller wrote:

> On Tue, Mar 19, 2002 at 08:40:18AM +0000, Jason Holt wrote:
> 
> > I've added the general form of generator checking to crypto/dh/dh_gen.c and
> > fixed the uninitialized t1,t2 bug.  It compiles, but I haven't really tested
> > it.  What I have so far is at:
> > 
> > http://www.lunkwill.org/dh_gen.c
> 
> I had not seen this message when I replied to the previous one.  As
> this time I'm replying to the list and not via private mail, here's my
> previous response:
> 
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> Thanks.  I now set t1 to 2 and t2 to 1 for 'non-standard' generators;
> i.e., any odd number is acceptable.  I suppose this is the fix you had
> in mind?
> 
> But the example call in dhtest.c indicates that you are not really
> supposed to call DH_generate_parameters with some integer as
> 'generator' argument -- instead, DH_GENERATOR_2 or DH_GENERATOR_5 can
> be used (these macros evaluate directly to 2 and 5, respectively, and
> no other DH_GENERATOR_... macros are defined).
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 
> 
> Actually the existing code is rather pointless.  There is no reason to
> insist to use a generator of the multiplicative group.  A generator of
> the order-q subgroup is, in some sense, better.  So I suggest to keep
> the current behaviour for cases 2 and 5 (mostly for backwards
> compatibility), and not to worry whether the number is a generator
> otherwise.  -- We should report an error for negative generators and
> for 0 and 1, though.
> 
> 
> 
> 

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to