gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r11343 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r11343 - gnunet/src/util
Date: Wed, 12 May 2010 07:57:42 +0200

Author: grothoff
Date: 2010-05-12 07:57:42 +0200 (Wed, 12 May 2010)
New Revision: 11343

Modified:
   gnunet/src/util/crypto_ksk.c
Log:
fix

Modified: gnunet/src/util/crypto_ksk.c
===================================================================
--- gnunet/src/util/crypto_ksk.c        2010-05-11 20:34:28 UTC (rev 11342)
+++ gnunet/src/util/crypto_ksk.c        2010-05-12 05:57:42 UTC (rev 11343)
@@ -162,20 +162,7 @@
   return mpz_sizeinbase (a, 2);
 }
 
-/**
- * Count the number of zerobits at the low end of A
- */
-static unsigned int
-get_trailing_zeros (mpz_t a)
-{
-  unsigned int count = 0;
-  unsigned int nbits = get_nbits (a);
 
-  while ((mpz_tstbit (a, count)) && (count < nbits))
-    count++;
-  return count;
-}
-
 /**
  * Set bit N of A. and clear all bits above
  */
@@ -240,7 +227,7 @@
 
   /* Find q and k, so that n = 1 + 2^k * q . */
   mpz_init_set (q, nminus1);
-  k = get_trailing_zeros (q);
+  k = mpz_scan0 (q, 0);
   mpz_tdiv_q_2exp (q, q, k);
 
   for (i = 0; i < steps; i++)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]