def dur

bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/secp256k1/pdec.bend:78

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

78def dur(+one: Nat, +h1: {one == 1n : Nat}, +x: List<&2, Nat>, +y: List<&2, Nat>, +hlx: {FS.limbs16(one, 16n, x) == True{} : Bool}, +hly: {FS.limbs16(one, 16n, y) == True{} : Bool}, a: Bool, bx: Bool, by: Bool, +hbx: {Nat.is_lt(FS.value(one, x), FS.prime(one)) == bx : Bool}, +hby: {Nat.is_lt(FS.value(one, y), FS.prime(one)) == by : Bool}) -> {PE.mpred(one, P.decode_u(x, y, Bool.and(Bool.and(a, Bool.and(bx, by)), P.on_curve(x, y)))) == True{} : Bool}:
79  match a bx by:
80    case True{} True{} True{}:
81      dur_ok(one, h1, x, y, SL.red_of(one, x, hlx, hbx), SL.red_of(one, y, hly, hby), P.on_curve(x, y))
82    case True{} True{} False{}:
83      {==}
84    case True{} False{} _:
85      {==}
86    case False{} _ _:
87      {==}

Uses (13)

Used by (1)