def ecrecover_v

bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/secp256k1/pecr.bend:66

import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pecr.bend as Pecr
import Base
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend as CV
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/ecdsa.bend as ES
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/bytes.bend as B
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/ecdsa.bend as E
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/blist.bend as BL

66# the ECRECOVER precompile
67def ecrecover_v(+one: Nat, +h1: {one == 1n : Nat}, +input: List<&2, U32>) -> {E.ecrecover(input) == ES.ecrecover(one, input) : Maybe<&2, List<&2, U32>>}:
68  %Equal.sym(List<&2, U32>, B.prefix(128n, List.append(&2, U32, input, List.replicate(U32, 128n, 0))), CV.first(128n, List.append(&2, U32, input, List.replicate(U32, 128n, 0))), BL.prefix_first(128n, List.append(&2, U32, input, List.replicate(U32, 128n, 0)))) : {E.ecrecover_in(_) == ES.ecrecover_in(one, CV.first(128n, List.append(&2, U32, input, List.replicate(U32, 128n, 0)))) : Maybe<&2, List<&2, U32>>}
69  ecin(one, h1, CV.first(128n, List.append(&2, U32, input, List.replicate(U32, 128n, 0))))

Uses (15)

Used by (1)