/[gzz]/manuscripts/Sigs/poss.py
ViewVC logotype

Diff of /manuscripts/Sigs/poss.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by tjl, Sun May 18 08:06:57 2003 UTC revision 1.5 by benja, Sun May 18 19:16:52 2003 UTC
# Line 1  Line 1 
 from __future__ import nested_scopes  
1  from fractions import fraction  from fractions import fraction
2  import math  import math
3  from math import log, log10, ceil  from math import log, log10, ceil
# Line 6  from math import log, log10, ceil Line 5  from math import log, log10, ceil
5  def lamport(h, b):  def lamport(h, b):
6      return (1, b, b*h, 2*b*h, h, 2*b, 0, b)      return (1, b, b*h, 2*b*h, h, 2*b, 0, b)
7    
8    def merkleI(h, b):
9        return (1, b, h*(b+ceil(log2(b))), h, h,
10                b + ceil(log2(b)) + 1, 0, b + ceil(log2(b)))
11    
12  def merkle_winternitz(h, b, n):  def merkle_winternitz(h, b, n):
13      return (1, b, fraction(b*h+h*n, n), h, h,      return (1, b, fraction(b*h+h*n, n), h, h,
14              fraction(2*b*(2L**n-1)+n, n),              fraction(2*b*(2L**n-1)+n, n),
# Line 17  def bleichenbacher_maurer(h, n): Line 20  def bleichenbacher_maurer(h, n):
20              3*(n+1)*h, h, h,              3*(n+1)*h, h, h,
21              9*n+2, 0, 9*n+2)              9*n+2, 0, 9*n+2)
22    
23    def times(j, S):
24        return (j*S[0], S[1], S[2], j*S[3], S[4], j*S[5], S[6], S[7])
25    
26  def merkle_hashtree(n, S):  def merkle_hashtree(n, S):
27      return (2L**n * S[0], S[1],      return (2L**n * S[0], S[1],
28                  S[2] + S[3] + n * S[4],                  S[2] + S[3] + n * S[4],
# Line 57  def printscheme(S): Line 63  def printscheme(S):
63    
64  schemes = []  schemes = []
65    
66  if 1:  if __name__ == '__main__':
67      for t in range(1, 40):      for t in range(1, 40):
68          n = ceil(160.0 / t )          n = ceil(160.0 / t )
69          #print "\n N = ",t, " n = ", n          #print "\n N = ",t, " n = ", n

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26