Skip to main content
Glama

CipherHUB Cryptography Toolkit

ml_dsa_verify

Read-only

[pqc_signature] 使用 ML-DSA 公钥验证签名(FIPS 204)。 【双模式】sign_mode 支持 RAW(默认)和 EXTERNAL_MU 两种模式,必须与签名时使用的模式一致。

  • RAW 模式:直接验证原始消息签名(liboqs,最大 256 字节,空消息合法)

  • EXTERNAL_MU 模式:先计算 mu,再通过 OpenSSL 3.5+ mu 模式验签,可验证 AWS KMS EXTERNAL_MU 签名(最大 2048 字节,空消息合法) 【算法】algorithm 支持 ML-DSA-44 / ML-DSA-65(默认)/ ML-DSA-87。 【参数】

  • public_key_spki_in_hex:公钥 hex(SPKI DER 或裸公钥均可),并校验 OID/长度与 algorithm 一致

  • message_in_hex:原始消息 hex,空字符串表示空消息

  • signature_in_hex:签名 hex

  • context_in_hex:签名时使用的 context(必须一致)

  • sign_mode:RAW 或 EXTERNAL_MU(默认 RAW) 【输出】verified(bool,True=验签通过)、algorithm、message_bytes。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ml_dsa_verify"
  }
}

Input Schema

NameRequiredDescriptionDefault
algorithmNo密码算法名称(具体可选值因工具而异,见工具描述)ML-DSA-65
sign_modeNoML-DSA 签名模式,可选值:RAW(默认,直接签名原文)/ EXTERNAL_MU(先计算 mu 再签名,与 AWS KMS 语义等价)RAW
context_in_hexNoML-DSA 上下文的十六进制字符串(可选,最大 255 字节)
message_in_hexNo消息的十六进制字符串(空字符串表示空消息)
signature_in_hexNo签名的十六进制字符串
public_key_spki_in_hexNoML-DSA 公钥的十六进制字符串(SPKI DER 或裸公钥均可)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / algorithm / description
      Added value: +"密码算法名称(具体可选值因工具而异,见工具描述)"
    • addedInput schema / properties / algorithm / enum
      Added value: +[
      +  "ML-DSA-44",
      +  "ML-DSA-65",
      +  "ML-DSA-87"
      +]
    • addedInput schema / properties / context_in_hex / description
      Added value: +"ML-DSA 上下文的十六进制字符串(可选,最大 255 字节)"
    • addedInput schema / properties / message_in_hex / description
      Added value: +"消息的十六进制字符串(空字符串表示空消息)"
    • addedInput schema / properties / public_key_spki_in_hex / description
      Added value: +"ML-DSA 公钥的十六进制字符串(SPKI DER 或裸公钥均可)"
    • addedInput schema / properties / sign_mode / description
      Added value: +"ML-DSA 签名模式,可选值:RAW(默认,直接签名原文)/ EXTERNAL_MU(先计算 mu 再签名,与 AWS KMS 语义等价)"
    • addedInput schema / properties / sign_mode / enum
      Added value: +[
      +  "RAW",
      +  "EXTERNAL_MU"
      +]
    • addedInput schema / properties / signature_in_hex / description
      Added value: +"签名的十六进制字符串"
  2. Changed1 schema field changed
    • addedInput schema / properties / sign_mode
      Added value: +{
      +  "default": "RAW",
      +  "title": "Sign Mode",
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, and the description is consistent with a pure verification operation. It adds substantial behavior beyond annotations: size limits (256 bytes RAW, 2048 bytes EXTERNAL_MU), empty messages being legal, OpenSSL 3.5+ requirement for mu mode, and OID/length validation of the key against the chosen algorithm.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then bracketed sections for mode, algorithm, parameters, and output. Slight redundancy with the schema descriptions (e.g., repeating that an empty string means an empty message), but every section maps to a real decision the agent must make.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Although no output schema exists, the description enumerates the return fields (verified, algorithm, message_bytes). Combined with mode constraints, size limits, and algorithm/key validation rules, an agent has everything needed to call this correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: the public key may be SPKI DER or a raw key and is validated for OID/length consistency, and context_in_hex must match the signing context. It does not clarify that all fields default to empty strings and are effectively required for a successful call.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource+standard: 'verify a signature with an ML-DSA public key (FIPS 204)'. The dual-mode explanation and algorithm enumeration make it clearly distinguishable from signing, keygen, and ml_dsa_compute_mu siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete selection criteria: sign_mode must match the mode used at signing time, RAW for liboqs raw-message signatures, EXTERNAL_MU for AWS KMS-style mu signatures. Missing only explicit exclusions or routing to sibling tools (e.g., when to use ml_dsa_compute_mu first).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.