verify static method
Verifies signature under publicKey using pqforge.
Use after threshold combine once M2 signing is implemented; also used in tests and migration paths that hold a full ML-DSA key.
Implementation
static bool verify({
required SchemeId scheme,
required Uint8List publicKey,
required Uint8List message,
required Uint8List signature,
Uint8List? context,
bool preHash = false,
}) {
final profile = MlDsaThresholdProfile.fromScheme(scheme);
if (publicKey.length != profile.publicKeyLength) {
return false;
}
if (signature.length != profile.signatureLength) {
return false;
}
return PqSignaturePrimitives.verify(
profile.pqforgeAlgorithm,
publicKey,
message,
signature,
context: context,
preHash: preHash,
);
}