std/crypto - edwards25519 precomp: prefer doublings over adds
Doublings are a little bit faster than additions, so use them half the time during precomputations.master
parent
58c2bec589
commit
83abb32247
|
@ -221,7 +221,7 @@ pub const Edwards25519 = struct {
|
|||
pc[1] = p;
|
||||
var i: usize = 2;
|
||||
while (i <= count) : (i += 1) {
|
||||
pc[i] = pc[i - 1].add(p);
|
||||
pc[i] = if (i % 2 == 0) pc[i / 2].dbl() else pc[i - 1].add(p);
|
||||
}
|
||||
return pc;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue