]> AND Private Git Repository - canny.git/blobdiff - stc/exp/raphus/bbs.py
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
complexity
[canny.git] / stc / exp / raphus / bbs.py
index 3ddbe0324aca1b18dbe8ecc087b787c7d3218fe4..88a5e6d0fc75ec2f1244be51af5615dfc0149fe0 100644 (file)
@@ -80,7 +80,7 @@ class BlumBlumShub(object):
         return p * q;
     
 
-    def __init__(self, bits):
+    def __init__(self, bits=160):
         """
         Constructor, specifing bits for n.
         bits - number of bits
@@ -116,9 +116,9 @@ class BlumBlumShub(object):
             x = x>>1 
         return q     
 
-    def next(self, numBits):
+    def next(self, numBits=160):
         self.state = (self.state**2) % self.n
-        return float(self.state)/self.n
+        return self.state
 
     def random(self):
         self.state = (self.state**2) % self.n