X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/canny.git/blobdiff_plain/8ee5d8b693307486fd2c72e82b9eb31af2f56ed0..1bfb9cc8f38edd065a52de421a0dc41567c4262c:/stc/exp/raphus/bbs.py?ds=inline diff --git a/stc/exp/raphus/bbs.py b/stc/exp/raphus/bbs.py index 3ddbe03..88a5e6d 100644 --- a/stc/exp/raphus/bbs.py +++ b/stc/exp/raphus/bbs.py @@ -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