std/crypto - edwards25519 precomp: prefer doublings over adds
Doublings are a little bit faster than additions, so use them half
the time during precomputations.
1 files changed, 1 insertions(+), 1 deletions(-)
lib/std/crypto/25519/edwards25519.zig+1-1
| ... | ... | @@ -221,7 +221,7 @@ pub const Edwards25519 = struct { |
| 221 | 221 | pc[1] = p; |
| 222 | 222 | var i: usize = 2; |
| 223 | 223 | while (i <= count) : (i += 1) { |
| 224 | | pc[i] = pc[i - 1].add(p); |
| 224 | pc[i] = if (i % 2 == 0) pc[i / 2].dbl() else pc[i - 1].add(p); |
| 225 | 225 | } |
| 226 | 226 | return pc; |
| 227 | 227 | } |