def ecrecover_in
bend-collections-laws-crypto@1.0.0.0 · src/crypto/secp256k1/ecdsa.bend:360
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/ecdsa.bend as Ecdsa
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/bytes.bend as B
360def ecrecover_in(+x: List<&2, U32>) -> Maybe<&2, List<&2, U32>>:
361 +vw = B.prefix(32n, B.suffix(32n, x))
362 +v = B.head(B.suffix(31n, vw))
363 ecrecover_v(B.prefix(32n, x), B.suffix(64n, x), v, Bool.and(zeros_ok(B.prefix(31n, vw)), Bool.or(U32.is_eq(v, 27), U32.is_eq(v, 28))))