verify
Verifies a SchnorrQ signature over the FourQ curve, returning true if the signature is valid for the given data and public key.
Signature
verify(data: Uint8Array, signature: Uint8Array, publicKey: Uint8Array): booleanPurpose
Verifies a SchnorrQ signature against a public key and message. Returns true if the signature is valid for the given data and key. Synchronous — no await needed.
import { sign, verify, publicKeyFromSeed } from "@qubic.org/crypto"
import { toSeed } from "@qubic.org/types"
const seed = toSeed("aaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")
const publicKey = publicKeyFromSeed(seed)
const message = new TextEncoder().encode("hello qubic")
const sig = await sign(message, seed)
const valid = verify(message, sig, publicKey)
// valid === trueParameters
| Name | Type | Description |
|---|---|---|
data | Uint8Array | The original signed bytes |
signature | Uint8Array | 64-byte SchnorrQ signature |
publicKey | Uint8Array | 32-byte FourQ public key |
Returns
boolean — true if the signature is valid, false otherwise.