def decode_65

bend-collections-laws-crypto@1.0.0.0 · src/crypto/secp256k1/point.bend:192

import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/point.bend as Point
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/field.bend as F
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/bytes.bend as B

192def decode_65(+pre: U32, +rest: List<&2, U32>) -> Maybe<&2, Point>:
193  +x = B.of_be(B.prefix(32n, rest))
194  +y = B.of_be(B.suffix(32n, rest))
195  decode_u(x, y, Bool.and(Bool.and(U32.is_eq(pre, 4), Bool.and(F.lt_p(x), F.lt_p(y))), on_curve(x, y)))

Uses (12)

Used by (5)