The unified diff between revisions [2b4b13ac..] and [1c2b7d38..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'bn_mp_gcd.c'

#
#
# patch "bn_mp_gcd.c"
#  from [a5ec727015fd307450f7718c481285dd1599d5d0]
#    to [bf556ea29d2e32c27105cd6f8ff69c4da406ba3a]
#
============================================================
--- bn_mp_gcd.c	a5ec727015fd307450f7718c481285dd1599d5d0
+++ bn_mp_gcd.c	bf556ea29d2e32c27105cd6f8ff69c4da406ba3a
@@ -12,7 +12,7 @@
  * The library is free for all purposes without any express
  * guarantee it works.
  *
- * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org
+ * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
  */

 /* Greatest Common Divisor using the binary method */
@@ -22,21 +22,13 @@ int mp_gcd (mp_int * a, mp_int * b, mp_i
   int     k, u_lsb, v_lsb, res;

   /* either zero than gcd is the largest */
-  if (mp_iszero (a) == 1 && mp_iszero (b) == 0) {
+  if (mp_iszero (a) == MP_YES) {
     return mp_abs (b, c);
   }
-  if (mp_iszero (a) == 0 && mp_iszero (b) == 1) {
+  if (mp_iszero (b) == MP_YES) {
     return mp_abs (a, c);
   }

-  /* optimized.  At this point if a == 0 then
-   * b must equal zero too
-   */
-  if (mp_iszero (a) == 1) {
-    mp_zero(c);
-    return MP_OKAY;
-  }
-
   /* get copies of a and b we can modify */
   if ((res = mp_init_copy (&u, a)) != MP_OKAY) {
     return res;
@@ -107,3 +99,7 @@ LBL_U:mp_clear (&v);
   return res;
 }
 #endif
+
+/* $Source: /cvs/libtom/libtommath/bn_mp_gcd.c,v $ */
+/* $Revision: 1.4 $ */
+/* $Date: 2006/03/31 14:18:44 $ */