svn commit: lorikeet r633 - in trunk/heimdal/lib/des/imath: .

lha at samba.org lha at samba.org
Sat Oct 21 17:22:56 GMT 2006


Author: lha
Date: 2006-10-21 17:22:55 +0000 (Sat, 21 Oct 2006)
New Revision: 633

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=633

Log:
merge with heidmal - update to imath 1.7
Modified:
   trunk/heimdal/lib/des/imath/imath.c
   trunk/heimdal/lib/des/imath/imath.h
   trunk/heimdal/lib/des/imath/imrat.c
   trunk/heimdal/lib/des/imath/imrat.h
   trunk/heimdal/lib/des/imath/iprime.c
   trunk/heimdal/lib/des/imath/iprime.h
   trunk/heimdal/lib/des/imath/rsamath.c
   trunk/heimdal/lib/des/imath/rsamath.h


Changeset:
Modified: trunk/heimdal/lib/des/imath/imath.c
===================================================================
--- trunk/heimdal/lib/des/imath/imath.c	2006-10-21 15:48:55 UTC (rev 632)
+++ trunk/heimdal/lib/des/imath/imath.c	2006-10-21 17:22:55 UTC (rev 633)
@@ -2,7 +2,7 @@
   Name:     imath.c
   Purpose:  Arbitrary precision integer arithmetic routines.
   Author:   M. J. Fromberger <http://www.dartmouth.edu/~sting/>
-  Info:     $Id: imath.c,v 1.4 2006/10/20 15:04:51 lha Exp $
+  Info:     $Id: imath.c,v 1.5 2006/10/21 16:32:12 lha Exp $
 
   Copyright (C) 2002 Michael J. Fromberger, All Rights Reserved.
 
@@ -1191,11 +1191,11 @@
     return MP_RANGE;
 
   um = MP_USED(m);
-  SETUP(mp_int_init_size(TEMP(0), 3 * um), last);
-  SETUP(mp_int_init_size(TEMP(1), 3 * um), last);
+  SETUP(mp_int_init_size(TEMP(0), 2 * um), last);
+  SETUP(mp_int_init_size(TEMP(1), 2 * um), last);
 
   if(c == b || c == m) {
-    SETUP(mp_int_init_size(TEMP(2), 3 * um), last);
+    SETUP(mp_int_init_size(TEMP(2), 2 * um), last);
     s = TEMP(2);
   } 
   else {
@@ -1767,7 +1767,7 @@
     return MP_RANGE;
 
   /* Skip leading whitespace */
-  while(isspace((unsigned char)*str))
+  while(isspace((int)*str))
     ++str;
 
   /* Handle leading sign tag (+/-, positive default) */
@@ -2196,7 +2196,7 @@
 
   /* Add corresponding digits until the shorter number runs out */
   for(pos = 0; pos < size_b; ++pos, ++da, ++db, ++dc) {
-    w = w + (mp_word)*da + (mp_word)*db;
+    w = w + (mp_word) *da + (mp_word) *db;
     *dc = LOWER_HALF(w);
     w = UPPER_HALF(w);
   }
@@ -2321,10 +2321,10 @@
     /* Assemble the output value */
     COPY(t1, dc, buf_size);
     (void) s_uadd(t3, dc + bot_size, dc + bot_size,
-		  buf_size + 1, buf_size + 1);
-
+		  buf_size + 1, buf_size + 1); 
+    
     (void) s_uadd(t2, dc + 2*bot_size, dc + 2*bot_size,
-		  buf_size, buf_size);
+		  buf_size, buf_size); 
     
     s_free(t1); /* note t2 and t3 are just internal pointers to t1 */
   } 
@@ -2909,7 +2909,7 @@
   umu = MP_USED(mu); db = MP_DIGITS(b); dbt = db + MP_USED(b) - 1;
 
   while(last < 3) 
-    SETUP(mp_int_init_size(TEMP(last), 2 * umu), last);
+    SETUP(mp_int_init_size(TEMP(last), 4 * umu), last);
 
   (void) mp_int_set_value(c, 1);
 
@@ -3101,10 +3101,10 @@
 {
   int out;
 
-  if(isdigit((unsigned char)c))
+  if(isdigit((unsigned char) c))
     out = c - '0';
-  else if(r > 10 && isalpha((unsigned char)c))
-    out = toupper((unsigned char)c) - 'A' + 10;
+  else if(r > 10 && isalpha((unsigned char) c))
+    out = toupper(c) - 'A' + 10;
   else
     return -1;
 

Modified: trunk/heimdal/lib/des/imath/imath.h
===================================================================
--- trunk/heimdal/lib/des/imath/imath.h	2006-10-21 15:48:55 UTC (rev 632)
+++ trunk/heimdal/lib/des/imath/imath.h	2006-10-21 17:22:55 UTC (rev 633)
@@ -2,7 +2,7 @@
   Name:     imath.h
   Purpose:  Arbitrary precision integer arithmetic routines.
   Author:   M. J. Fromberger <http://www.dartmouth.edu/~sting/>
-  Info:     $Id: imath.h,v 1.2 2006/10/07 19:43:43 lha Exp $
+  Info:     $Id: imath.h,v 1.3 2006/10/21 16:32:15 lha Exp $
 
   Copyright (C) 2002 Michael J. Fromberger, All Rights Reserved.
 

Modified: trunk/heimdal/lib/des/imath/imrat.c
===================================================================
--- trunk/heimdal/lib/des/imath/imrat.c	2006-10-21 15:48:55 UTC (rev 632)
+++ trunk/heimdal/lib/des/imath/imrat.c	2006-10-21 17:22:55 UTC (rev 633)
@@ -2,7 +2,7 @@
   Name:     imrat.c
   Purpose:  Arbitrary precision rational arithmetic routines.
   Author:   M. J. Fromberger <http://www.dartmouth.edu/~sting/>
-  Info:     $Id: imrat.c,v 1.4 2006/10/07 19:43:45 lha Exp $
+  Info:     $Id: imrat.c,v 1.5 2006/10/21 16:32:19 lha Exp $
 
   Copyright (C) 2002 Michael J. Fromberger, All Rights Reserved.
 
@@ -800,7 +800,7 @@
     return res;
 
   /* Skip whitespace between numerator and (possible) separator */
-  while(isspace((unsigned char)*endp))
+  while(isspace((unsigned char) *endp))
     ++endp;
   
   /* If there is no separator, we will stop reading at this point. */
@@ -915,7 +915,7 @@
       *end = endp;
     return MP_OK;
   }
-  else if(isspace((unsigned char)*endp) || *endp == '-' || *endp == '+') {
+  else if(isspace((unsigned char) *endp) || *endp == '-' || *endp == '+') {
     return MP_TRUNC;
   }
   else {

Modified: trunk/heimdal/lib/des/imath/imrat.h
===================================================================
--- trunk/heimdal/lib/des/imath/imrat.h	2006-10-21 15:48:55 UTC (rev 632)
+++ trunk/heimdal/lib/des/imath/imrat.h	2006-10-21 17:22:55 UTC (rev 633)
@@ -2,7 +2,7 @@
   Name:     imrat.h
   Purpose:  Arbitrary precision rational arithmetic routines.
   Author:   M. J. Fromberger <http://www.dartmouth.edu/~sting/>
-  Info:     $Id: imrat.h,v 1.2 2006/10/07 19:43:48 lha Exp $
+  Info:     $Id: imrat.h,v 1.3 2006/10/21 16:32:23 lha Exp $
 
   Copyright (C) 2002 Michael J. Fromberger, All Rights Reserved.
 

Modified: trunk/heimdal/lib/des/imath/iprime.c
===================================================================
--- trunk/heimdal/lib/des/imath/iprime.c	2006-10-21 15:48:55 UTC (rev 632)
+++ trunk/heimdal/lib/des/imath/iprime.c	2006-10-21 17:22:55 UTC (rev 633)
@@ -2,7 +2,7 @@
   Name:     iprime.c
   Purpose:  Pseudoprimality testing routines
   Author:   M. J. Fromberger <http://www.dartmouth.edu/~sting/>
-  Info:     $Id: iprime.c,v 1.2 2006/10/07 19:43:50 lha Exp $
+  Info:     $Id: iprime.c,v 1.3 2006/10/21 16:32:26 lha Exp $
 
   Copyright (C) 2002 Michael J. Fromberger, All Rights Reserved.
 

Modified: trunk/heimdal/lib/des/imath/iprime.h
===================================================================
--- trunk/heimdal/lib/des/imath/iprime.h	2006-10-21 15:48:55 UTC (rev 632)
+++ trunk/heimdal/lib/des/imath/iprime.h	2006-10-21 17:22:55 UTC (rev 633)
@@ -2,7 +2,7 @@
   Name:     iprime.h
   Purpose:  Pseudoprimality testing routines
   Author:   M. J. Fromberger <http://www.dartmouth.edu/~sting/>
-  Info:     $Id: iprime.h,v 1.2 2006/10/07 19:43:52 lha Exp $
+  Info:     $Id: iprime.h,v 1.3 2006/10/21 16:32:30 lha Exp $
 
   Copyright (C) 2002 Michael J. Fromberger, All Rights Reserved.
 

Modified: trunk/heimdal/lib/des/imath/rsamath.c
===================================================================
--- trunk/heimdal/lib/des/imath/rsamath.c	2006-10-21 15:48:55 UTC (rev 632)
+++ trunk/heimdal/lib/des/imath/rsamath.c	2006-10-21 17:22:55 UTC (rev 633)
@@ -3,7 +3,7 @@
   Purpose:  Implements part of PKCS#1, v. 2.1, June 14, 2002 (RSA Labs)
   Author:   M. J. Fromberger <http://www.dartmouth.edu/~sting/>
             Copyright (C) 2002 Michael J. Fromberger, All Rights Reserved.
-  Info:     $Id: rsamath.c,v 1.2 2006/10/07 19:43:55 lha Exp $
+  Info:     $Id: rsamath.c,v 1.3 2006/10/21 16:32:33 lha Exp $
 
   Permission is hereby granted, free of charge, to any person
   obtaining a copy of this software and associated documentation files

Modified: trunk/heimdal/lib/des/imath/rsamath.h
===================================================================
--- trunk/heimdal/lib/des/imath/rsamath.h	2006-10-21 15:48:55 UTC (rev 632)
+++ trunk/heimdal/lib/des/imath/rsamath.h	2006-10-21 17:22:55 UTC (rev 633)
@@ -2,7 +2,7 @@
   Name:     rsamath.h
   Purpose:  Implements part of PKCS#1, v. 2.1, June 14, 2002 (RSA Labs)
   Author:   M. J. Fromberger <http://www.dartmouth.edu/~sting/>
-  Info:     $Id: rsamath.h,v 1.2 2006/10/07 19:43:57 lha Exp $
+  Info:     $Id: rsamath.h,v 1.3 2006/10/21 16:32:36 lha Exp $
 
   Copyright (C) 2002 Michael J. Fromberger, All Rights Reserved.
 



More information about the samba-cvs mailing list