authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2020-08-16 00:58:14+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-16 22:35:28-07:00
log7f9a227abfbce0e67746cc57dd9b6a4bf0a8d94a
tree36beac5edb4683d4b14bd395addcf55f846e315d
parent37ae2464053628d10c7e7e7165ba8a267006b0ad

deinline edwards25519.{add,dbl}


1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/crypto/25519/edwards25519.zig+2-2
...@@ -74,7 +74,7 @@ pub const Edwards25519 = struct {...@@ -74,7 +74,7 @@ pub const Edwards25519 = struct {
74 }74 }
7575
76 /// Double an Edwards25519 point.76 /// Double an Edwards25519 point.
77 pub inline fn dbl(p: Edwards25519) Edwards25519 {77 pub fn dbl(p: Edwards25519) Edwards25519 {
78 const t0 = p.x.add(p.y).sq();78 const t0 = p.x.add(p.y).sq();
79 var x = p.x.sq();79 var x = p.x.sq();
80 var z = p.y.sq();80 var z = p.y.sq();
...@@ -91,7 +91,7 @@ pub const Edwards25519 = struct {...@@ -91,7 +91,7 @@ pub const Edwards25519 = struct {
91 }91 }
9292
93 /// Add two Edwards25519 points.93 /// Add two Edwards25519 points.
94 pub inline fn add(p: Edwards25519, q: Edwards25519) Edwards25519 {94 pub fn add(p: Edwards25519, q: Edwards25519) Edwards25519 {
95 const a = p.y.sub(p.x).mul(q.y.sub(q.x));95 const a = p.y.sub(p.x).mul(q.y.sub(q.x));
96 const b = p.x.add(p.y).mul(q.x.add(q.y));96 const b = p.x.add(p.y).mul(q.x.add(q.y));
97 const c = p.t.mul(q.t).mul(Fe.edwards25519d2);97 const c = p.t.mul(q.t).mul(Fe.edwards25519d2);