Bodo Moeller wrote:
> 
> [EMAIL PROTECTED]:
> 
> >  I've attached a test program that spits them out to you.
> 
> >   a=0;
> >   b=0;
> >   do {
> >     do {
> >       idea_mul1(r1,a,b,ul);
> >       r2=idea_mul3(a,b);
> >       if(r1!=r2)
> >      fprintf(stderr," ?? r1!=r2 (a=0x%04x,b=0x%04x) (r1=0x%04x,r2=0x%04x)}
> > \n",a,b,r1,r2);
> >     } while(++a != 0xFFFF);
> >   } while(++b != 0xFFFF);
> 
> Note that valid input values to the idea_mul macros are 16 bit
> unsigned integers.  

 That is also kind or weared. The idea_mul macro is used
 in the E_IDEA macro ('called' with an argument that is never
 used). Which operates on the (not passed) arguments  

   x1,x2,x3,x4,t0,t1,ul;

 in the function idea_encrypt (i_cbc.c) which are of type
 'unsigned long'. But I've already changed the type to unit16
 and it doesn't make any difference.
 
> In this test program,  a  will grow beyond 16 bits
> (for most compilers and architectures).
>

 Uhh.. I don't think so.

 Well i should have initialized a to 0 within the 
 outer loop ok.... but I'm testing for 0xFFFF at the end
 of the loops and terminate then.

 After incrementing 0xFFFF I have to end up at
 0x0000 because a and b have the type uint16 which
 per definitionem can not hold more than 16 bits.
 I do not know about any platform or architecture
 on which this should be different.


 Anyway. That has not been the initial question. Is there anything
 wrong with the three different implementations of the mul procedure ?
 I think that's more important. Since (as you might have seen) mul1 and mul2
 do generate different results due to the fact that the idae_mul1 macro
 doesn't do the '(a-b) + (a<b)' stuff.

 Regards

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

-- 
**********************************
Dr. Sebastian Kloska
Head of Bioinformatics
Scienion AG
Volmerstr. 7a
12489 Berlin
phone: +49-(30)-6392-1708
fax:   +49-(30)-6392-1701
http://www.scienion.de
**********************************
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to