X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/canny.git/blobdiff_plain/8ee5d8b693307486fd2c72e82b9eb31af2f56ed0..3d3a92a59f998403d73c474b6565a18b3c248dec:/stc/exp/raphus/bbs.py?ds=sidebyside 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