module

Schnorr

Constants

GX = BigInt.new("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", 16)
GY = BigInt.new("483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", 16)
N = BigInt.new("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16)
P = BigInt.new("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", 16)

Instance methods

valid_signature?(msg_hex : String, pub_hex : String, sig_hex : String) : Bool

Full BIP-340 Schnorr verification: lift the x-only public key to a point P with even y, compute the tagged challenge e = int(sha256(sha256(tag) || sha256(tag) || r || pubkey || msg)) mod n and accept iff R = sG - eP is not infinity, has even y and x(R) == r.

Source

Nested types