Skip to main content
Glama

CipherHUB Cryptography Toolkit

ml_dsa_compute_mu

Read-only

[pqc_signature] 独立计算 ML-DSA 的 64 字节 mu 值(FIPS 204 Section 6.2)。 【用途】用于验证或调试 EXTERNAL_MU 模式的中间值,或与 AWS KMS EXTERNAL_MU 签名流程对接。 【计算公式】

  • tr = SHAKE-256(raw_pk, 64)

  • M' = 0x00 || len(ctx) || ctx || message

  • mu = SHAKE-256(tr || M', 64) 【参数】

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

  • message_in_hex:原始消息 hex(最大 2048 字节,空字符串表示空消息)

  • context_in_hex:可选上下文 hex(最大 255 字节)

  • algorithm:ML-DSA-44 / ML-DSA-65(默认)/ ML-DSA-87 【输出】tr_in_hex、mu_in_hex、raw_pk_in_hex、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_compute_mu"
  }
}

Input Schema

NameRequiredDescriptionDefault
algorithmNo密码算法名称(具体可选值因工具而异,见工具描述)ML-DSA-65
context_in_hexNoML-DSA 上下文的十六进制字符串(可选,最大 255 字节)
message_in_hexNo消息的十六进制字符串(空字符串表示空消息)
public_key_spki_in_hexNoML-DSA 公钥的十六进制字符串(SPKI DER 或裸公钥均可)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 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 或裸公钥均可)"
  2. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered; the description adds real value beyond that with input limits (message ≤ 2048 bytes, context ≤ 255 bytes) and the fact that the public key's OID and length are validated against the chosen algorithm. It does not discuss failure modes when validation fails, which keeps it from a 5.

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 the one-line purpose, then sectioned into 用途 / 计算公式 / 参数 / 输出, which lets an agent skim to the relevant block. The explicit formula is arguably more than an agent needs to select and call the tool, but it is short and genuinely defines the operation.

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

Completeness4/5

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

With no output schema, the description correctly compensates by enumerating the return fields (tr_in_hex, mu_in_hex, raw_pk_in_hex, algorithm, message_bytes). Input constraints and algorithm options are all covered, leaving only error behavior unspecified.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description does add some meaning beyond the schema — that public_key_spki_in_hex accepts either SPKI DER or a raw public key and is cross-checked against the algorithm, and that an empty message string means an empty message — but these mostly restate or lightly extend the schema field descriptions.

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?

Names a specific verb and resource ('独立计算 ML-DSA 的 64 字节 mu 值') and pins it to FIPS 204 Section 6.2, so the agent knows exactly which intermediate artifact is produced. The stated use case (EXTERNAL_MU intermediate value / AWS KMS interop) implicitly separates it from the sibling ml_dsa_sign and ml_dsa_verify, which produce or consume full signatures rather than mu.

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?

The 【用途】 block gives a clear when-to-use condition: verifying or debugging EXTERNAL_MU-mode intermediates, or wiring into an AWS KMS EXTERNAL_MU signing flow. It stops short of an explicit exclusion (e.g. 'do not use this for ordinary signing, use ml_dsa_sign'), so 4 rather than 5.

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.