49 |
S[7] + n + 1) |
S[7] + n + 1) |
50 |
|
|
51 |
def key_boosting(N, S): |
def key_boosting(N, S): |
52 |
|
""" |
53 |
|
slightly off because random oracle calls not taken into account |
54 |
|
""" |
55 |
return (S[0] ** N, |
return (S[0] ** N, |
56 |
S[1], |
S[1], |
57 |
N * (S[2] + S[3]), |
N * (S[2] + S[3]), |
62 |
N * (S[7]) |
N * (S[7]) |
63 |
) |
) |
64 |
|
|
65 |
|
def key_boosting_real(N, n, h): |
66 |
|
""" |
67 |
|
key_boosting(N, merkle_hashtree(n, merkleI(h, h))) |
68 |
|
with random oracle calls taken into account |
69 |
|
""" |
70 |
|
S = key_boosting(N, merkle_hashtree(n, merkleI(h, h))) |
71 |
|
bits = h+ceil(log2(h)) |
72 |
|
return (S[0], |
73 |
|
S[1], |
74 |
|
S[2], |
75 |
|
S[3], |
76 |
|
S[4], |
77 |
|
S[5] + n*bits, # assume we store only h bits as privkey |
78 |
|
# and generate first privkey through oracle |
79 |
|
S[6] + N*n*bits, |
80 |
|
S[7]) |
81 |
|
|
82 |
def unfract(s): |
def unfract(s): |
83 |
if s.__class__ != fraction: |
if s.__class__ != fraction: |
84 |
return s |
return s |