3 void sc25519_slide(signed char r
[256], const sc25519
*s
, int swindowsize
)
5 int i
,j
,k
,b
,m
=(1<<(swindowsize
-1))-1, soplen
=256;
6 unsigned long long sv0
= s
->v
[0];
7 unsigned long long sv1
= s
->v
[1];
8 unsigned long long sv2
= s
->v
[2];
9 unsigned long long sv3
= s
->v
[3];
11 /* first put the binary expansion into r */
23 /* Making it sliding window */
24 for (j
= 0;j
< soplen
;++j
)
27 for (b
= 1;b
< soplen
- j
&& b
<= 6;++b
) {
28 if (r
[j
] + (r
[j
+ b
] << b
) <= m
)
30 r
[j
] += r
[j
+ b
] << b
; r
[j
+ b
] = 0;
32 else if (r
[j
] - (r
[j
+ b
] << b
) >= -m
)
34 r
[j
] -= r
[j
+ b
] << b
;
35 for (k
= j
+ b
;k
< soplen
;++k
)