def secret_ok
import bend-collections@1.0.0.0/spec/crypto/secp256k1/schnorr.bend as Schnorrimport Base
import bend-collections@1.0.0.0/spec/crypto/secp256k1/curve.bend as CV
103# d' = int(sk), 1 <= d' <= n - 1
104def secret_ok(+one: Nat, +sk: List<&2, U32>) -> Bool:
105 Bool.and(CV.length_is(32n, sk), Bool.and(Bool.not(Nat.is_eq(CV.os2ip(sk), 0n)), Nat.is_lt(CV.os2ip(sk), n(one))))