def sign_d
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/schnorr.bend as Schnorrimport Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/point.bend as P
145def sign_d(+m: List<&2, U32>, +aux: List<&2, U32>, md: Maybe<&2, List<&2, Nat>>) -> Maybe<&2, List<&2, U32>>:
146 match md:
147 case None{}: None{}
148 case Some{+d0}: sign_p(d0, m, aux, P.to_affine(P.mul(d0, P.g())))