def secret_ok

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/secp256k1/schnorr.bend:103

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/schnorr.bend as Schnorr
import Base
import bend-collections-laws-crypto@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))))

Uses (11)

Used by (4)