Encapsulate a shared secret
crypto_kem_encapsulateEncapsulate a shared secret to an ML-KEM (FIPS 203) public key and receive the KEM ciphertext plus a symmetric-256 key handle for use with crypto_encrypt.
Instructions
Encapsulate a shared secret to an ML-KEM (FIPS 203) public key (512, 768, 1024). Returns the KEM ciphertext for the recipient and a symmetric-256 keyHandle for the shared secret, usable with crypto_encrypt. Secret key material stays inside the server; only an opaque keyHandle is returned.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"publicKey": "<publicKey>"
},
"name": "crypto_kem_encapsulate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | ML-KEM security level (512, 768, or 1024). Default is 768. | |
| publicKey | Yes | Hex-encoded ML-KEM public key (1600, 2368, or 3136 hex characters). |