verify static method

bool verify({
  1. required SchemeId scheme,
  2. required Uint8List publicKey,
  3. required Uint8List message,
  4. required Uint8List signature,
  5. Uint8List? context,
  6. bool preHash = false,
})

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,
  );
}