Point.add: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/crypto/ed25519/point.bend as Point Lines 66-78 of bend-collections@1.0.0.0/src/crypto/ed25519/point.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/point.bend&start_line=66&end_line=78 import Base import bend-collections@1.0.0.0/src/crypto/curve25519/field.bend as F # RFC 8032 5.1.4, addition def add(+c: Cs, p: Pt, q: Pt) -> Pt: match p q: case Pt{+x1, +y1, +z1, +t1} Pt{+x2, +y2, +z2, +t2}: +a = F.mul(F.sub(y1, x1), F.sub(y2, x2)) +b = F.mul(F.add(y1, x1), F.add(y2, x2)) +cc = F.mul(F.mul(t1, cs_d2(c)), t2) +dd = F.mul(F.add(z1, z1), z2) +e = F.sub(b, a) +f = F.sub(dd, cc) +g = F.add(dd, cc) +h = F.add(b, a) Pt{F.mul(e, f), F.mul(g, h), F.mul(f, g), F.mul(e, h)} Uses (6): https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/curve25519/field.bend&name=add https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/curve25519/field.bend&name=mul https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/curve25519/field.bend&name=sub https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/point.bend&name=Cs https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/point.bend&name=Pt https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/point.bend&name=cs_d2