Skip to main content
Glama

CipherHUB Cryptography Toolkit

ml_kem_decap

Read-only

[pqc_kem] 使用 ML-KEM 私钥执行密钥解封装(FIPS 203)。 【算法】ML-KEM-512 / ML-KEM-768 / ML-KEM-1024。 【参数】

  • algorithm:必须与 keygen/encap 一致

  • secret_key_in_hex:ml_kem_keygen 返回的私钥 hex

  • ciphertext_in_hex:ml_kem_encap 返回的密文 hex 【输出】shared_secret_in_hex、shared_secret_in_base64、shared_secret_sha256、shared_secret_bytes、algorithm。 【安全特性】若密文被篡改,ML-KEM Implicit Rejection 不抛异常,返回确定性伪随机值(IND-CCA2 安全),不泄露私钥信息。 【完整流程】keygen → encap(pub) → decap(sk, ct) → 双方 shared_secret 一致

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_kem_decap"
  }
}

Input Schema

NameRequiredDescriptionDefault
algorithmNo密码算法名称(具体可选值因工具而异,见工具描述)ML-KEM-768
ciphertext_in_hexNoML-KEM 密文的十六进制字符串
secret_key_in_hexNoML-KEM 私钥的十六进制字符串

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / algorithm / description
      Added value: +"密码算法名称(具体可选值因工具而异,见工具描述)"
    • addedInput schema / properties / algorithm / enum
      Added value: +[
      +  "ML-KEM-512",
      +  "ML-KEM-768",
      +  "ML-KEM-1024"
      +]
    • addedInput schema / properties / ciphertext_in_hex / description
      Added value: +"ML-KEM 密文的十六进制字符串"
    • addedInput schema / properties / secret_key_in_hex / description
      Added value: +"ML-KEM 私钥的十六进制字符串"
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description carries the real behavioral burden and does: it discloses that a tampered ciphertext triggers Implicit Rejection, returns a deterministic pseudorandom value rather than throwing, and leaks no private-key information (IND-CCA2). That is exactly the non-obvious behavior an agent needs before calling a decapsulation primitive.

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 action, then bracketed sections for algorithm, parameters, output, security, and workflow — easy to scan and nothing is buried. Minor waste: the 【算法】 line enumerates the three variants that the schema enum already supplies.

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?

There is no output schema, and the description compensates fully by listing the returned fields (shared_secret_in_hex, _base64, _sha256, _bytes, algorithm). Combined with the security note and pipeline description, an agent has everything needed to call and interpret this tool 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; the description earns above that by adding provenance and a cross-tool constraint the schema cannot express — secret_key_in_hex comes from ml_kem_keygen's return, ciphertext_in_hex from ml_kem_encap's return, and algorithm must match both. It does not add format examples, but the hex-string semantics are already covered by the schema.

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?

States a specific verb+resource: '使用 ML-KEM 私钥执行密钥解封装(FIPS 203)', naming the standard and the three parameter sets. The 【完整流程】 line (keygen → encap → decap) positions it precisely against the sibling tools ml_kem_keygen and ml_kem_encap, so an agent can tell which step this is without opening a schema.

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 【参数】 section says algorithm '必须与 keygen/encap 一致' and the 【完整流程】 line establishes this is the third step after keygen and encap, giving clear when-to-use context. It lacks an explicit exclusion (e.g., when to prefer a different KEM), but within this tool family the routing is unambiguous.

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.