CVS: crypto/Util RFC1751.py,1.5,1.6 number.py,1.10,1.11

"A.M. Kuchling" <[email protected]> Fri, 04 Apr 2003 07:15:24 -0800
Newsgroups gmane.comp.python.cryptography.cvs
Message-ID <[email protected]>
Update of /cvsroot/pycrypto/crypto/Util
In directory sc8-pr-cvs1:/tmp/cvs-serv12922

Modified Files:
	RFC1751.py number.py 
Log Message:
Code formatting improvements; shouldn't be any semantic changes

Index: RFC1751.py
===================================================================
RCS file: /cvsroot/pycrypto/crypto/Util/RFC1751.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RFC1751.py	28 Feb 2003 15:26:00 -0000	1.5
+++ RFC1751.py	4 Apr 2003 15:15:10 -0000	1.6
@@ -53,9 +53,9 @@
     for index in range(0, len(L), 6):
         sublist=L[index:index+6] ; char=9*[0] ; bits=0
         for i in sublist:
-            index=wordlist.index(i)
-            shift=(8-(bits+11)%8) %8
-            y=index<<shift
+            index = wordlist.index(i)
+            shift = (8-(bits+11)%8) %8
+            y = index << shift
             cl, cc, cr = (y>>16), (y>>8)&0xff, y & 0xff
             if (shift>5):
                 char[bits/8] = char[bits/8] | cl

Index: number.py
===================================================================
RCS file: /cvsroot/pycrypto/crypto/Util/number.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- number.py	3 Apr 2003 18:41:06 -0000	1.10
+++ number.py	4 Apr 2003 15:15:13 -0000	1.11
@@ -83,18 +83,23 @@
     """isPrime(N:long):bool
     Return true if N is prime.
     """
-    if N == 1: return 0
-    if N in sieve: return 1
+    if N == 1:
+        return 0
+    if N in sieve:
+        return 1
     for i in sieve:
-        if (N % i)==0: return 0
+        if (N % i)==0:
+            return 0
 
     # Use the accelerator if available
     if _fastmath is not None:
         return _fastmath.isPrime(N)
 
     # Compute the highest bit that's set in N
-    N1=N - 1L ; n=1L
-    while (n<N): n=n<<1L
+    N1 = N - 1L
+    n = 1L
+    while (n<N):
+        n=n<<1L
     n = n >> 1L
 
     # Rabin-Miller test



-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/