def encode
import bend-collections@1.0.0.0/src/crypto/ed25519/point.bend as Pointimport Base
import bend-collections@1.0.0.0/src/crypto/curve25519/field.bend as F
125# RFC 8032 5.1.2
126def encode(p: Pt) -> List<&2, U32>:
127 match p:
128 case Pt{+x, +y, +z, t}:
129 +zi = F.inv(z)
130 set_top(F.to_bytes(F.mul(y, zi)), F.parity(F.mul(x, zi)))