List Info

Thread: OpenSSL: openssl/crypto/bn/ bn_prime.c bn_prime.h bn_prime.pl




OpenSSL: openssl/crypto/bn/ bn_prime.c bn_prime.h bn_prime.pl
country flaguser name
Germany
2007-09-18 15:52:06
  OpenSSL CVS Repository
  http://cvs.openssl.org/
 
____________________________________________________________
________________

  Server: cvs.openssl.org                  Name:   Andy
Polyakov
  Root:   /v/openssl/cvs                   Email:  approopenssl.org
  Module: openssl                          Date:  
18-Sep-2007 22:52:06
  Branch: HEAD                             Handle:
2007091821520500

  Modified files:
    openssl/crypto/bn       bn_prime.c bn_prime.h
bn_prime.pl

  Log:
    Minimize stack utilization in probable_prime.

  Summary:
    Revision    Changes     Path
    1.36        +2  -2      openssl/crypto/bn/bn_prime.c
    1.5         +3  -1      openssl/crypto/bn/bn_prime.h
    1.5         +3  -1      openssl/crypto/bn/bn_prime.pl
 
____________________________________________________________
________________

  patch -p0 <<' .'
  Index: openssl/crypto/bn/bn_prime.c
 
============================================================
================
  $ cvs diff -u -r1.35 -r1.36 bn_prime.c
  --- openssl/crypto/bn/bn_prime.c	18 Sep 2006 14:00:49
-0000	1.35
  +++ openssl/crypto/bn/bn_prime.c	18 Sep 2007 20:52:05
-0000	1.36
   -377,14 +377,14 
   static int probable_prime(BIGNUM *rnd, int bits)
   	{
   	int i;
  -	BN_ULONG mods[NUMPRIMES];
  +	prime_t mods[NUMPRIMES];
   	BN_ULONG delta,maxdelta;
   
   again:
   	if (!BN_rand(rnd,bits,1,1)) return(0);
   	/* we now have a random number 'rand' to test. */
   	for (i=1; i<NUMPRIMES; i++)
  -		mods[i]=BN_mod_word(rnd,(BN_ULONG)primes[i]);
  +		mods[i]=(prime_t)BN_mod_word(rnd,(BN_ULONG)primes[i]);
   	maxdelta=BN_MASK2 - primes[NUMPRIMES-1];
   	delta=0;
   	loop: for (i=1; i<NUMPRIMES; i++)
   .
  patch -p0 <<' .'
  Index: openssl/crypto/bn/bn_prime.h
 
============================================================
================
  $ cvs diff -u -r1.4 -r1.5 bn_prime.h
  --- openssl/crypto/bn/bn_prime.h	16 Feb 2000 13:24:06
-0000	1.4
  +++ openssl/crypto/bn/bn_prime.h	18 Sep 2007 20:52:05
-0000	1.5
   -58,10 +58,12 
   
   #ifndef EIGHT_BIT
   #define NUMPRIMES 2048
  +typedef unsigned short prime_t;
   #else
   #define NUMPRIMES 54
  +typedef unsigned char prime_t;
   #endif
  -static const unsigned int primes[NUMPRIMES]=
  +static const prime_t primes[NUMPRIMES]=
   	{
   	   2,   3,   5,   7,  11,  13,  17,  19,
   	  23,  29,  31,  37,  41,  43,  47,  53,
   .
  patch -p0 <<' .'
  Index: openssl/crypto/bn/bn_prime.pl
 
============================================================
================
  $ cvs diff -u -r1.4 -r1.5 bn_prime.pl
  --- openssl/crypto/bn/bn_prime.pl	25 Sep 2003 13:57:58
-0000	1.4
  +++ openssl/crypto/bn/bn_prime.pl	18 Sep 2007 20:52:05
-0000	1.5
   -101,10 +101,12 
   
   printf "#ifndef EIGHT_BITn";
   printf "#define NUMPRIMES %dn",$num;
  +printf "typedef unsigned short prime_t;n";
   printf "#elsen";
   printf "#define NUMPRIMES %dn",$eight;
  +printf "typedef unsigned char prime_t;n";
   printf "#endifn";
  -print "static const unsigned int
primes[NUMPRIMES]=nt{nt";
  +print "static const prime_t
primes[NUMPRIMES]=nt{nt";
   $init=0;
   for ($i=0; $i <= $#primes; $i++)
   	{
   .
____________________________________________________________
__________
OpenSSL Project                                 http://www.openssl.org
CVS Repository Commit List                    
openssl-cvsopenssl.org
Automated List Manager                          
majordomoopenssl.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )