| author | |
| committer | |
| log | 83abb322478a148aeb6206e10f0f72e70d35c67d |
| tree | f259c28f2f56bad086960c676b4f65b3cf5b4bc1 |
| parent | 58c2bec589d6d90db31744430407bc88695b5161 |
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,7 +221,7 @@ pub const Edwards25519 = struct { |
| 221 | pc[1] = p; | 221 | pc[1] = p; |
| 222 | var i: usize = 2; | 222 | var i: usize = 2; |
| 223 | while (i <= count) : (i += 1) { | 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 | return pc; | 226 | return pc; |
| 227 | } | 227 | } |