def scalar_ok_v
bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/secp256k1/pscal.bend:20
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pscal.bend as Pscal
import Base
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/spec/crypto/secp256k1/ecdsa.bend as ES
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/scalar.bend as S
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/fwrap.bend as FW
20def scalar_ok_v(+one: Nat, +h1: {one == 1n : Nat}, +x: List<&2, Nat>) -> {E.scalar_ok(x) == ES.scalar_ok(one, FS.value(one, x)) : Bool}:
21 %Equal.sym(Bool, S.is_zero(x), Nat.is_eq(FS.value(one, x), 0n), FW.is_zero_s(one, h1, x)) : {Bool.and(Bool.not(_), S.lt_n(x)) == Bool.and(Bool.not(Nat.is_eq(FS.value(one, x), 0n)), Nat.is_lt(FS.value(one, x), FS.order(one))) : Bool}
22 %Equal.sym(Bool, S.lt_n(x), Nat.is_lt(FS.value(one, x), FS.order(one)), FW.lt_n_s(one, h1, x)) : {Bool.and(Bool.not(Nat.is_eq(FS.value(one, x), 0n)), _) == Bool.and(Bool.not(Nat.is_eq(FS.value(one, x), 0n)), Nat.is_lt(FS.value(one, x), FS.order(one))) : Bool}
23 {==}