def to_affine
import bend-collections@1.0.0.0/spec/crypto/secp256k1/curve.bend as Curveimport Base
import bend-collections@1.0.0.0/spec/crypto/secp256k1/field.bend as FS
169# (X / Z, Y / Z), (0, 0) for the point at infinity
170def to_affine(+p: Nat, a: SPoint) -> SAffine:
171 match a:
172 case SPoint{x, y, z}: aff_z(p, x, y, FS.minv(p, z))
Uses (5)
Used by (8)
- bend-collections@1.0.0.0/spec/crypto/secp256k1/curve:encode_uncompressed
- bend-collections@1.0.0.0/spec/crypto/secp256k1/curve:encode_compressed
- bend-collections@1.0.0.0/spec/crypto/secp256k1/ecdsa:attempt_ok
- bend-collections@1.0.0.0/spec/crypto/secp256k1/ecdsa:verify_rs
- bend-collections@1.0.0.0/spec/crypto/secp256k1/schnorr:pubkey_ok
- …