|
Algorithm 6 Adaptive method. |
Input: , the bit length of s, , is the precomputation tuple for Output:
-
1:
Write s in signed binary form, with
-
2:
-
3:
fortokdo
-
4:
-
5:
end for
-
6:
fortoddo
-
7:
-
8:
end for
-
9:
fordown to 0 do
-
10:
-
11:
for
to
k
do
-
12:
-
13:
-
14:
Compute
-
15:
-
16:
if
then
-
17:
-
18:
Compute
-
19:
-
20:
-
21:
end if
-
22:
end for
-
23:
for
to
d
do
-
24:
-
25:
if
then
-
26:
-
27:
else if
then
-
28:
-
29:
end if
-
30:
end for
-
31:
end for
-
32:
fortokdo
-
33:
-
34:
-
35:
Compute
-
36:
-
37:
-
38:
Compute
-
39:
-
40:
end for
-
41:
fortoddo
-
42:
-
43:
-
44:
end for
-
45:
-
46:
returnf
|