def finish
import bend-collections-laws-crypto@1.0.0.0/src/crypto/curve25519/x25519.bend as X25519import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/curve25519/field.bend as F
117# the final cswap, then x2 * z2^(p - 2), encoded
118def finish(st: St) -> List<&2, U32>:
119 match st:
120 case St{+x2, +z2, +x3, +z3, +swap}:
121 F.to_bytes(F.mul(F.select(swap, x2, x3), F.inv(F.select(swap, z2, z3))))