def equal

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/ed25519.bend:188

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/ed25519.bend as Ed25519
import Base
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/field.bend as FS

188# the same point: X1 Z2 == X2 Z1 and Y1 Z2 == Y2 Z1
189def equal(+p: Nat, a: EPt, b: EPt) -> Bool:
190  match a b:
191    case EPt{+x1, +y1, +z1, t1} EPt{+x2, +y2, +z2, t2}:
192      Bool.and(Nat.is_eq(FS.fmul(p, x1, z2), FS.fmul(p, x2, z1)), Nat.is_eq(FS.fmul(p, y1, z2), FS.fmul(p, y2, z1)))

Uses (6)

Used by (3)