def dcr
bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/secp256k1/pdec.bend:30
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pdec.bend as Pdec
import Base
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/sel.bend as SL
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/field.bend as FS
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/point.bend as P
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/penc.bend as PE
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/blist.bend as BL
30def dcr(+one: Nat, +h1: {one == 1n : Nat}, +pre: U32, +x: List<&2, Nat>, +hl: {FS.limbs16(one, 16n, x) == True{} : Bool}, a: Bool, b: Bool, +hb: {Nat.is_lt(FS.value(one, x), FS.prime(one)) == b : Bool}) -> {PE.mpred(one, P.decode_c(x, U32.to_nat(U32.and(pre, 1)), Bool.and(a, b))) == True{} : Bool}:
31 match a b:
32 case True{} True{}:
33 PE.decompress_r(one, h1, x, U32.to_nat(U32.and(pre, 1)), SL.red_of(one, x, hl, hb), BL.par01(pre))
34 case True{} False{}:
35 {==}
36 case False{} _:
37 {==}