def even_b
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/schnorr.bend as Schnorrimport Base
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/field.bend as FS
46# n - x when y is odd (the key or nonce whose point has even y)
47def even_b(+m: Nat, b: Nat, +x: Nat) -> Nat:
48 match b:
49 case 0n: x
50 case 1n+k: FS.mneg(m, x)