Doca Aes Gcm
NVIDIAOfficialCreated by NVIDIA
- Skill
- Tool integration
- Software development
- Apache-2.0
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides technical guidance for developers integrating the DOCA AES-GCM library into applications running on BlueField DPUs or ConnectX NICs. It covers the lifecycle of AES-GCM tasks, including configuration, capability discovery, buffer management, and security-critical error handling. The skill emphasizes the AEAD (Authenticated Encryption with Associated Data) nature of AES-GCM, ensuring developers correctly handle authentication tags and avoid common pitfalls like confusing GCM with non-authenticated AES modes.
What it does
- Guides the configuration of doca_aes_gcm_task_encrypt and doca_aes_gcm_task_decrypt.
- Provides rules for querying device capabilities regarding supported key sizes (128/256-bit) and buffer limits.
- Defines security-first error handling, specifically for tag-verification-failed outcomes.
- Outlines correct mmap permission settings for source and destination buffers.
- Assists in validating implementations against standard test vectors like NIST GCMVS or RFC 5288.
- Routes users to appropriate resources for non-GCM modes or general key management.
When to use it
- When developing applications that offload AES-GCM operations to NVIDIA hardware.
- When debugging DOCA_ERROR codes related to AES-GCM task execution.
- When determining if a specific AES-GCM configuration is supported on a target device.
- When implementing decryption logic and needing to handle authentication tag failures securely.
- When choosing between hardware-accelerated DOCA AES-GCM and CPU-based OpenSSL implementations.
Advantages
- Ensures secure handling of AEAD primitives by treating tag verification as a security event.
- Provides clear boundaries between supported AES-GCM features and unsupported modes like CBC or CTR.
- Standardizes the approach to capability discovery and error taxonomy across DOCA versions.
- Promotes best practices for memory management and buffer sizing in hardware-accelerated workflows.
Usage examples
- “How do I check if my BlueField DPU supports AES-256-GCM?”
- The agent will guide you to use the doca_aes_gcm_cap_task_encrypt_is_key_type_supported query to verify support for DOCA_AES_GCM_KEY_256.
- “My decrypt task returned an IO_FAILED error, what should I do?”
- The agent will explain that this indicates an authentication tag verification failure, meaning the data is untrusted and must not be consumed.
- “Can I use this library for AES-192-GCM?”
- The agent will clarify that AES-192 is not supported by the DOCA AES-GCM library and recommend using a CPU-based library instead.
- “What permissions are required for my mmap buffers?”
- The agent will provide the required flags, such as DOCA_ACCESS_FLAG_LOCAL_READ_ONLY for source buffers and DOCA_ACCESS_FLAG_LOCAL_READ_WRITE for destination buffers.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/nvidia/doca-aes-gcm/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip doca-aes-gcm.zip -d .agents/skills
Documentation by NVIDIA
DOCA AES-GCM
Examples
"Auth tag isn't verifying on decrypt." — this is in scope. Treat tag-verification-failed as a security outcome, not a retryable size error.
"Is AES-192-GCM on this BlueField?" — no. Only key-128 and key-256 exist; do not invent AES-192 or CBC/CTR offload.
Instructions
Follow Loading order below. Open the tasks companion for configure / test / debug. Open the capabilities companion for key types and the AEAD safety note. Do not open every companion file.
Where to start: This skill assumes DOCA is already installed and
the user is doing hands-on AES-GCM-acceleration work on a
BlueField / ConnectX / host with DOCA. Open the tasks companion if
the user wants to do something (configure / build / modify / run /
test / debug); open the capabilities companion when the
question is what can DOCA AES-GCM express on this version. If the
user has not installed DOCA yet, route to
doca-setup/SKILL.md first. If the user is
asking "should I even use the accelerator for this encryption?",
the path-selection rule in
Capabilities and modes
is the first stop. If the user is treating AES-GCM as a confidentiality-only primitive (raw AES-CTR / AES-CBC style), stop and read the AEAD note in ## Safety policy first — AES-GCM is authenticated encryption, and confusing the two is the most expensive failure mode this skill exists to prevent.
Example questions this skill answers well
The CLASSES of DOCA AES-GCM questions this skill is built to answer, each with one worked example. The agent should treat the class as the load-bearing piece — the worked example is a single instance.
"Should I offload this AES-GCM encryption to DOCA AES-GCM, or just do it on the CPU with OpenSSL?" — worked example: "I am encrypting 4 KiB TLS records at line rate; is doca-aes-gcm worth the setup vs OpenSSL
EVP_aes_256_gcmon the CPU?". Answered by the path-selection table inCapabilities and modes
the "when NOT to use doca-aes-gcm" bullets in
Safety policy.
"Does my device support the AES-GCM key size I want?" — worked example: "is AES-256-GCM in the accelerator on this BlueField? And while we're here, is AES-192-GCM available?" (Answer: the library exposes only
DOCA_AES_GCM_KEY_128/DOCA_AES_GCM_KEY_256; AES-192 is not in the enum and is not supported. For the two real key types, gate ondoca_aes_gcm_cap_task_encrypt_is_key_type_supported(devinfo, key_type)and the matching_decrypt_is_key_type_supported. AES-192 is not available — route to a CPU library.) Answered by the per-key-type capability queries and the per-taskdoca_aes_gcm_cap_task_*_is_supportedqueries inCapabilities and modes
the discovery step in
configure.
"How do I correctly decrypt an AES-GCM message and verify the auth tag?" — worked example: "my
doca_aes_gcm_task_decryptcompletion reports an error — is the plaintext output safe to use?". Answered by the auth-tag verification rule inSafety policy
(do not use the plaintext if the auth tag did not verify) + the decrypt completion-handling workflow in
test and
debug.
"What permissions does the source / destination mmap need?" — worked example: "my
doca_aes_gcm_task_encryptreturnsDOCA_ERROR_NOT_PERMITTED". Answered by the permission matrix in ## Safety policythe mmap-set-permissions checklist in
test.
"Is this DOCA AES-GCM API available on my installed DOCA version?" — worked example: "is AES-192-GCM in the DOCA I have installed, on this device?". Answered by the version-compatibility overlay in
Version compatibility,
which cross-links the canonical detection chain in
doca-version/SKILL.mdand adds the AES-GCM-specific "discover key sizes via cap query" bullets."What does this
DOCA_ERROR_*from an AES-GCM call mean and which layer caused it?" — worked example: "DOCA_ERROR_NOT_PERMITTEDon my encrypt buffer". Answered by the AES-GCM overlay on the cross-library taxonomy inError taxonomy
the layered ladder in
debug that escalates to
doca-debug/SKILL.md.
IO_FAILEDon a decrypt completion is not a debugging question. It means auth tag verification failed, and that is a security event, not a code or configuration bug — there is nothing to classify by layer and nothing to escalate todoca-debug/SKILL.md. The plaintext that task produced is poisoned and must not be consumed; the decrypt must not be retried; the input ciphertext is tampered or corrupted and must be treated as untrusted; the outcome belongs to the caller's application-layer policy for tampered input. Lead with that. Only if the user is testing against known-good vectors is a configuration cause (wrong key, IV, AAD, or tag length) worth raising, and even then it comes second. Full rule inError taxonomy
and
## Safety policy.
Audience
This skill serves external developers building applications that
consume the DOCA AES-GCM library — i.e., users whose code calls
doca_aes_gcm_* (directly in C/C++, or through FFI/bindings from
another language) to offload AES-GCM authenticated encryption /
decryption onto a BlueField DPU or ConnectX accelerator. It is not
for NVIDIA developers contributing to DOCA AES-GCM itself.
Language scope. DOCA AES-GCM ships as a C library with
pkg-config module name doca-aes-gcm. The shipped samples are
written in C. C and C++ consumers are the canonical case and the
worked examples in the tasks companion assume that path. Other-language
consumers (Rust, Go, Python, …) consume the same *.so through FFI
or language-specific bindings; the skill's contribution in that case
is to keep the lifecycle, capability-discovery, permission,
error-taxonomy, AEAD-semantics, and encrypt-vs-decrypt guidance
language-neutral, and to route the agent to the public C ABI as the
authoritative surface that any wrapper will eventually call.
Key handling is out of scope. This skill teaches the agent how to use the DOCA AES-GCM library; it does not teach the user how to generate, store, rotate, or distribute AES-GCM keys. Key-management is the user's responsibility (a KMS, an HSM, a sealed file, an env var the user trusts). The skill's only key-handling rule is the operational one in
Safety policy:
do not log keys, do not commit them to source, and treat any key buffer the program holds as sensitive memory.
When to load this skill
Load this skill when the user is doing hands-on DOCA AES-GCM work, in any language. Concretely:
Initializing a
doca_aes_gcmcontext on adoca_devand configuring at least one task type (doca_aes_gcm_task_encryptand/ordoca_aes_gcm_task_decrypt) beforedoca_ctx_start().Choosing between encrypt (
doca_aes_gcm_task_encrypt— takes key + IV + AAD + plaintext, produces ciphertext + auth tag) and decrypt (doca_aes_gcm_task_decrypt— takes key + IV + AAD + ciphertext + expected auth tag, produces plaintext and verifies the tag) for the user's data shape.Setting permissions on
doca_mmapcorrectly for the source buffer (DOCA_ACCESS_FLAG_LOCAL_READ_ONLYat minimum — the plaintext on encrypt or the ciphertext on decrypt) and the destination buffer (DOCA_ACCESS_FLAG_LOCAL_READ_WRITE).Checking which AES-GCM key types (
DOCA_AES_GCM_KEY_128/DOCA_AES_GCM_KEY_256— AES-192 is not in the library) the active device's accelerator advertises viadoca_aes_gcm_cap_task_encrypt_is_key_type_supported/doca_aes_gcm_cap_task_decrypt_is_key_type_supported, and which task types viadoca_aes_gcm_cap_task_encrypt_is_supported/_task_decrypt_is_supported.Sizing the per-submission plaintext against
doca_aes_gcm_cap_task_encrypt_get_max_buf_size(devinfo).Validating an encrypt + decrypt round-trip against a published AES-GCM test vector (NIST GCMVS, or RFC 5288 examples) before pushing any user data through the accelerator.
Handling the auth-tag verification result on decrypt completions as a security-critical signal — a tag-mismatch completion means the ciphertext was tampered with or corrupted, and the plaintext output of that task is poisoned and must not be consumed.
Debugging a
DOCA_ERROR_*returned from an AES-GCM call (lifecycle vs. unsupported key size vs. permission vs. tag verification failure on decrypt) and the task-completion event on the progress engine.Designing or extending non-C bindings (Rust, Go, Python, …) that wrap the AES-GCM C ABI — for the lifecycle, permission, capability, AEAD-semantics, and encrypt-vs-decrypt rules the wrapper must honor.
Do not load this skill for general DOCA orientation, install of
DOCA itself, AES modes that are not GCM (CBC / CTR / XTS — those are
not in this library and CPU + OpenSSL is the right answer), SHA
hashing on the same accelerator family (use
doca-sha/SKILL.md), or other DOCA libraries. For
those, use
doca-public-knowledge-map/SKILL.md.
What this skill provides
This is a thin loader. The body keeps only the orientation needed to pick the right next file. The substantive AES-GCM-specific material lives in two companion files:
the capabilities companion — what DOCA AES-GCM can express on this version: the two task types (encrypt and decrypt), the AEAD output shape (ciphertext + auth tag on encrypt; verified plaintext on decrypt), the AES-GCM key-type surface (only 128-bit and 256-bit — AES-192 is not in the enum, both cap-queried), the capability-query surface (
doca_aes_gcm_cap_*for task presence, key-type support, and buffer sizing), the AES-GCM error taxonomy (mapped onto the cross-libraryDOCA_ERROR_*set, with explicit treatment of the tag-verification-failure outcome as security-critical), the observability surface (per-task completion events on the progress engine), the safety policy that gates source / destination mmap permission decisions and key-handling cautions, and the path-selection rule (when to use doca-aes-gcm versus CPU OpenSSL or a different DOCA crypto library).the tasks companion — step-by-step workflows for the six in-scope AES-GCM verbs:
configure,build,modify,run,test,debug. Plus aDeferred task verbsblock that points out-of-scope questions at the right next skill.
The skill assumes a host or BlueField where DOCA is already
installed at the standard location and the user has the privileges
their public install profile expects. It does not cover installing
DOCA — that path goes through
doca-setup/SKILL.md.
What this skill deliberately does not ship
This skill is agent guidance, not a samples or templates bundle. To keep the boundary clean, it deliberately does not contain — and pull requests should not add:
Pre-written DOCA AES-GCM application source code, in any language. The verified AES-GCM source code is the shipped C samples at
/opt/mellanox/doca/samples/doca_aes_gcm/. The agent's job is to route the user to those files and prescribe a minimum-diff modification on them via the universal modify-a-sample workflow indoca-programming-guide/SKILL.md, layered with the AES-GCM-specific overrides inmodify.
Pre-computed AES-GCM test vectors. The skill tells the agent to use a published test vector (e.g. NIST GCMVS, RFC 5288 AES-GCM examples) as the known-vector smoke; it does not ship a vector bank of its own. The agent must cite the vector source so the user can audit it.
Pre-baked AES-GCM keys, IVs, or AAD strings. A key in this repo is a key in every customer's repo — by construction, it must not be there. The skill teaches the shape of the inputs; the user supplies the actual bytes from their own key-management system.
Standalone build manifests (
meson.build,CMakeLists.txt,Cargo.toml, …) parked inside the skill. The agent constructs the build manifest in the user's project directory against the user's installed DOCA, wherepkg-config --modversion doca-aes-gcmis the source of truth.A
samples/,bindings/, orreference/subtree of any kind. A mock or incomplete artifact in this skill's tree, even one labeled "reference", is misleading: users will read it as buildable.
Loading order
Read this skill first to confirm the user's question is in scope.
For the AES-GCM capability matrix, task types, key-size surface, capability-query rules, permission matrix, AEAD semantics, error taxonomy, observability, and safety / path-selection policy, see the capabilities companion.
For step-by-step workflows — configure, build, modify, run, test, debug — see the tasks companion.
Both companion files cross-link to each other,
doca-version/SKILL.md for the canonical
version-handling rules, and
doca-public-knowledge-map/SKILL.md
whenever the right answer is "look it up in the public docs or the
installed package layout" rather than "AES-GCM-specific guidance".
Related skills
doca-public-knowledge-map/SKILL.md— the routing table for every public DOCA documentation source and the on-disk layout of an installed DOCA package. The DOCA AES-GCM page lives atdocs.nvidia.com/doca/sdk/DOCA-AES-GCM/; it is a member of the DOCA Crypto Acceleration family alongsidedoca-sha/SKILL.md.doca-setup/SKILL.md— env preparation, install verification, and the I have no install yet path with the public NGC DOCA container. This skill assumes its preconditions are satisfied.doca-version/SKILL.md— canonical DOCA version-handling rules. This skill's## Version compatibilitycross-links the four-way match rule and adds only the AES-GCM-specific "discover key sizes + task presence via cap query" overlay.doca-structured-tools-contract/SKILL.md— the bundle's structured-tools precedence rule (detect / prefer / fall back / report). The Command appendix in the tasks companion honors this contract.doca-programming-guide/SKILL.md— general DOCA programming patterns shared by every library: the canonicalpkg-config+ meson build pattern, the universal modify-a-shipped-sample first-app workflow, the universal lifecycle, the cross-libraryDOCA_ERROR_*taxonomy, and the program-side debug order. This skill layers AES-GCM specifics on top.doca-sha/SKILL.md— the sibling library in the DOCA Crypto Acceleration family for hardware-accelerated SHA hashing. Load alongside this skill when the user's flow is authenticated-encryption with a separate keyed hash (rare — AES-GCM already provides authentication via its tag) or when the user is comparing offload paths between the two.doca-debug/SKILL.md— the cross-cutting debug ladder (install / version / build / link / runtime / program / driver). AES-GCM-specific debug (key-size-not-supported, oversized input, tag-verification failure on decrypt) overlays on top of that ladder.
Files
- ATTRIBUTION.mdAdded by AutoGineer894 B
- BENCHMARK.md9.8 KiB
- CAPABILITIES.md26.8 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md16.4 KiB
- SKILLCARD.yaml2.7 KiB
- TASKS.md28.8 KiB
- evals/evals.json3.9 KiB
- skill-card.md5.1 KiB
- skill.oms.sig5.1 KiB
CAPABILITIES.md
DOCA AES-GCM capabilities, version overlay, errors, observability, safety
Where to start: Pick the H2 anchor that matches your question (capabilities / version / errors / observability / safety) and read that section end-to-end. The tables in each section are the load-bearing content; the prose around them is interpretation.
Read this file when the loader sent you here from
SKILL.md. For the how of executing each pattern (the
verbs configure / build / modify / run / test / debug), jump to
TASKS.md. For the canonical DOCA version-handling rules
that this skill layers an AES-GCM overlay on top of, see
doca-version/SKILL.md.
Pattern overview
Every DOCA AES-GCM question this skill teaches resolves into one of SIX patterns. The patterns are CLASSES — they apply across every AES-GCM release and every BlueField / ConnectX device the accelerator runs on.
| Pattern | When it applies (class shape) | Where the substance lives |
|---|---|---|
| 1. Decide whether to offload | Compare the per-call setup cost of doca-aes-gcm against a CPU AES-GCM (OpenSSL EVP_aes_*_gcm) on the same input; choose offload only when the input is bulk, sustained, or already pinned in doca_mmap memory | ## Capabilities and modes path-selection table + ## Safety policy "when NOT to use doca-aes-gcm" bullets |
| 2. Pick the task type | Encrypt (doca_aes_gcm_task_encrypt) to produce ciphertext + auth tag from plaintext + key + IV + AAD; decrypt (doca_aes_gcm_task_decrypt) to verify the tag and produce plaintext from ciphertext + key + IV + AAD + expected tag | ## Capabilities and modes encrypt-vs-decrypt table + TASKS.md ## modify |
| 3. Discover capabilities | Query doca_aes_gcm_cap_* for task-type presence, per-key-size support, and max plaintext size per submission, against the active doca_devinfo BEFORE choosing the key size or sizing buffers | ## Capabilities and modes capability-query rule + TASKS.md ## configure step 2 |
| 4. Honor source / destination permissions | Source mmap = DOCA_ACCESS_FLAG_LOCAL_READ_ONLY at minimum; destination mmap = DOCA_ACCESS_FLAG_LOCAL_READ_WRITE; both must be set BEFORE the first task submission | ## Safety policy permission matrix + TASKS.md ## test |
| 5. Treat auth-tag verification as security-critical | On decrypt, the auth tag MUST verify before the plaintext output is consumed. A failed verification is a security-relevant event — the ciphertext was tampered with or corrupted, and the plaintext output of that task is poisoned | ## Error taxonomy decrypt-failure row + ## Safety policy AEAD-discipline section |
| 6. Diagnose an AES-GCM error | Map symptom (DOCA_ERROR_BAD_STATE, _INVALID_VALUE, _NOT_SUPPORTED, _NOT_PERMITTED, _AGAIN, _IO_FAILED) to root cause — lifecycle, key-size, oversized input, permission, queue pressure, or tag verification failure — without leaving the AES-GCM layer prematurely | ## Error taxonomy + TASKS.md ## debug |
Three cross-cutting rules that apply to every pattern above:
AES-GCM is AEAD, not raw AES. AES-GCM provides confidentiality AND integrity in one operation; the auth tag on encrypt and the tag verification on decrypt are not optional add-ons. Treating AES-GCM like AES-CTR (where there is no tag) or AES-CBC (where authentication is a separate HMAC) is the single most common baseline-agent error. If the user wants a non-AEAD AES mode, the answer is CPU + OpenSSL — not this library.
Discover the version-installed surface, do not assume. Every pattern above gates on
pkg-config --modversion doca-aes-gcmand on thedoca_aes_gcm_cap_*capability queries against the activedoca_devinfo. Quoting a key-size, a max plaintext size, or even the presence of the encrypt or decrypt task without checking is the most common hallucination failure mode.Validate against a published test vector before bulk. The cheapest way to confirm the configured AES-GCM context produces a correct ciphertext + tag is to encrypt + decrypt a small fixed input (e.g. a NIST GCMVS vector or an RFC 5288 AES-GCM example) with a known key + IV + AAD and verify both directions match the published output, before submitting any user data.
Capabilities and modes
DOCA AES-GCM is a DOCA Core Context. Every AES-GCM instance
follows the universal cfg-create → cfg-set-* → init → start → use → stop → destroy lifecycle (see
doca-programming-guide CAPABILITIES.md ## Capabilities and modes (doca-programming-guide/CAPABILITIES.md#capabilities-and-modes)).
On top of that lifecycle, DOCA AES-GCM layers its own task model and
key-size-selection surface.
The two task types. DOCA AES-GCM exposes two task types; each has
its own doca_aes_gcm_task_*_set_conf (enable the task) and its own
matching doca_aes_gcm_cap_task_*_is_supported (capability query)
entry point. The agent must call the capability query before assuming
the task type is available on the user's device.
| Task type | Class shape | Notes |
|---|---|---|
doca_aes_gcm_task_encrypt | Take a single source doca_buf (plaintext) + key + IV + optional AAD, produce ciphertext in a destination doca_buf plus an authentication tag | Asynchronous; completion arrives via doca_pe_progress. The output is ciphertext + a tag the receiver must check. The plaintext-per-submission ceiling is doca_aes_gcm_cap_task_encrypt_get_max_buf_size(devinfo). |
doca_aes_gcm_task_decrypt | Take a single source doca_buf (ciphertext) + key + IV + optional AAD + expected auth tag, verify the tag, produce plaintext in a destination doca_buf | Asynchronous; completion arrives via doca_pe_progress. Tag verification is mandatory — if the completion reports a verification failure, the plaintext output is not safe to consume (see ## Safety policy). |
Path selection — encrypt vs decrypt. The two task types are
independent surfaces; a single AES-GCM context can have both enabled
(typical) or just one (e.g. a producer side only encrypts; a
consumer side only decrypts). Choose at least one before
doca_ctx_start().
| Path | What it is | Right shape for | Wrong shape for |
|---|---|---|---|
| Encrypt only | Configure only doca_aes_gcm_task_encrypt; the context produces ciphertext + tag for downstream consumers | A producer-only pipeline (log-shipper that encrypts before send, a backup writer encrypting before storing) | Any flow that also needs to consume incoming AES-GCM-protected data on the same context |
| Decrypt only | Configure only doca_aes_gcm_task_decrypt; the context consumes ciphertext + tag and produces verified plaintext | A consumer-only pipeline (a TLS record receiver, a backup reader decrypting before processing) | Any flow that also needs to produce outgoing AES-GCM-protected data on the same context |
| Both | Both tasks enabled on the same context | A symmetric peer that both encrypts outbound and decrypts inbound (the canonical case for an end-to-end encrypted channel) | A read-only or write-only flow — enabling the unused side adds setup overhead without benefit |
Path-selection — when to use DOCA AES-GCM at all. The agent's rule:
Use doca-aes-gcm when the input is bulk (rule of thumb: ≥ a few KiB per record and sustained), the throughput requirement is high enough that freeing the CPU for other work is valuable, or the input is already pinned in
doca_mmapmemory because another DOCA library produced it. TLS record encryption at line rate, encrypted storage (data-at-rest pipelines), and high-throughput backup encryption are the canonical fits.Do NOT use doca-aes-gcm when the input is a single tiny message (the per-call DMA-to-accelerator setup cost dominates; CPU + AES-NI is faster); when the user needs a non-GCM AES mode (CBC, CTR, XTS — use CPU + OpenSSL, not this library); or when the user needs only a keyed hash for authentication without encryption (use
doca-sha/SKILL.mdfor hashing, or a CPU HMAC).
AES-GCM key sizes — only 128 and 256. AES-GCM is defined in
the spec for 128 / 192 / 256-bit keys, but the DOCA AES-GCM
library's enum doca_aes_gcm_key_type exposes only
DOCA_AES_GCM_KEY_128 and DOCA_AES_GCM_KEY_256 — AES-192-GCM
is NOT expressible through this library at all. The agent must
not invent an AES-192 path. Per-device support for each of the
two real key types is still cap-gated: call
doca_aes_gcm_cap_task_encrypt_is_key_type_supported(devinfo, key_type)
and the matching _decrypt_is_key_type_supported query before
sizing key material.
| Key size (bits) | doca_aes_gcm_key_type enum value | Key length (bytes) | Notes |
|---|---|---|---|
| 128 | DOCA_AES_GCM_KEY_128 = 1 | 16 | Often supported; the smallest AES-GCM key the library accepts |
| 256 | DOCA_AES_GCM_KEY_256 = 2 | 32 | Often supported; the most common choice for new deployments |
| 192 | (not in the enum) | (n/a) | NOT supported by the DOCA AES-GCM library — route to a CPU library if AES-192 is a hard requirement |
The agent must NOT quote either of the two real key types as
universally available — the cap query against the active
doca_devinfo is the runtime authority. A response that
recommends a key size without first naming the cap query — or
that quotes AES-192 as a per-device-cap-queried option — is the
baseline-agent failure mode this skill exists to prevent.
Capability discovery — the only rule. Before choosing a key size
or sizing any plaintext buffer, call the matching
doca_aes_gcm_cap_* query against the active doca_devinfo:
| Capability | Query | Why the agent must ask |
|---|---|---|
| Encrypt task supported | doca_aes_gcm_cap_task_encrypt_is_supported(devinfo) | If false, the device has no AES-GCM encrypt accelerator and the user must fall back to CPU |
| Decrypt task supported | doca_aes_gcm_cap_task_decrypt_is_supported(devinfo) | If false, the device has no AES-GCM decrypt accelerator; the user must fall back to CPU for inbound |
| Key type supported for encrypt | doca_aes_gcm_cap_task_encrypt_is_key_type_supported(devinfo, key_type) | Per-key-type boolean against the real enum doca_aes_gcm_key_type (DOCA_AES_GCM_KEY_128 or DOCA_AES_GCM_KEY_256); AES-192-GCM is NOT in the enum and cannot be queried |
| Key type supported for decrypt | doca_aes_gcm_cap_task_decrypt_is_key_type_supported(devinfo, key_type) | Same surface for the decrypt task |
| Maximum encrypt plaintext size | doca_aes_gcm_cap_task_encrypt_get_max_buf_size(devinfo) | Hardware-bound ceiling on plaintext size per submission; inputs larger than this require the user to fragment at the application layer |
Configuration shape. Mandatory configurations before
doca_ctx_start(): at least one task type enabled via
doca_aes_gcm_task_encrypt_set_conf or
doca_aes_gcm_task_decrypt_set_conf, and the matching mmap
permissions set on both source and destination buffers per the
matrix in ## Safety policy. Key material is
typically passed as part of the per-task setup; key bytes never live
in the skill or in the configured context for longer than the user's
own program needs them.
Version compatibility
For the canonical DOCA version-detection chain, the four-way match
rule, NGC container semantics, and the headers-win-over-docs rule,
see doca-version/SKILL.md. The body lives
there; this skill does not duplicate it.
The AES-GCM-specific overlay is:
Per-key-type membership is device-bound, not version-bound. The agent must not infer "DOCA version X includes a third AES-GCM key size" from release notes alone — the public
enum doca_aes_gcm_key_typehas two values (DOCA_AES_GCM_KEY_128,DOCA_AES_GCM_KEY_256); AES-192-GCM is NOT in the enum and is not expressible through this library. For the two real key types, the runtime authority isdoca_aes_gcm_cap_task_encrypt_is_key_type_supported(devinfo, key_type)/_decrypt_is_key_type_supported(devinfo, key_type)against the active device. Per the cross-cutting cap-query rule indoca-version CAPABILITIES.md ## Observability(doca-version/CAPABILITIES.md#observability), the cap query is the runtime authority — never quote a key type as available from agent memory.Per-device task presence is independent of the library install. An install that ships the
doca-aes-gcmshared object (verify withldconfig -p | grep -i doca_aes_gcm; the on-disk basename uses underscores) does not guarantee a particular device exposes both encrypt and decrypt; some device generations advertise only one. Confirm viadoca_aes_gcm_cap_task_encrypt_is_supported(devinfo)and_task_decrypt_is_supported(devinfo)per the cross-cutting cap-query rule above; if one returns false on a device the user expected to support it, route todoca-version TASKS.md ## debug(doca-version/TASKS.md#debug) before invoking the missing codepath.doca-aes-gcm.pcplusdoca-common.pcmust both matchdoca_caps --versionat the four-way-match check (perdoca-version CAPABILITIES.md ## Version compatibility(doca-version/CAPABILITIES.md#version-compatibility)). A common partial-install pattern on hosts where the AES-GCM package was installed separately from the rest of DOCA is thatdoca-aes-gcm.pcreports release X whiledoca-common.pcreports release Y; route todoca-version TASKS.md ## debug(doca-version/TASKS.md#debug) layer 2 before any AES-GCM-layer diagnosis.
Error taxonomy
AES-GCM-specific overlays on the cross-library DOCA_ERROR_*
taxonomy. The cross-library taxonomy itself lives in
doca-programming-guide CAPABILITIES.md ## Error taxonomy (doca-programming-guide/CAPABILITIES.md#error-taxonomy);
the rows below are the AES-GCM surface meaning that the agent must
disambiguate before falling back to the cross-library response.
| Error | AES-GCM context where it shows up | AES-GCM-specific cause |
|---|---|---|
DOCA_ERROR_BAD_STATE | Any call after doca_ctx_stop() or before doca_ctx_start(); task submit before the matching _set_conf ran | Lifecycle violation. Walk the call sequence against the lifecycle in doca-programming-guide CAPABILITIES.md ## Capabilities and modes (doca-programming-guide/CAPABILITIES.md#capabilities-and-modes); confirm the task type the user is submitting was enabled via doca_aes_gcm_task_*_set_conf before doca_ctx_start(). |
DOCA_ERROR_INVALID_VALUE | doca_aes_gcm_task_*_alloc_init; submit time | The configured key size is not in the supported set, OR the plaintext exceeds doca_aes_gcm_cap_task_encrypt_get_max_buf_size(devinfo), OR the auth tag length the user passed does not match the AES-GCM spec. Re-run the matching cap query, then resize or correct the tag length. |
DOCA_ERROR_NOT_SUPPORTED | _task_*_set_conf; submit with an unsupported key type | The task type is not in this device's accelerator, OR the configured key type is not in this device's supported set. Re-run doca_aes_gcm_cap_task_*_is_supported / _is_key_type_supported against the active doca_devinfo; if false, that is the answer — fall back to CPU or change the key type. |
DOCA_ERROR_NOT_PERMITTED | First task submission | The source mmap does not have DOCA_ACCESS_FLAG_LOCAL_READ_ONLY (or a stronger flag that supersedes it), OR the destination mmap is missing DOCA_ACCESS_FLAG_LOCAL_READ_WRITE, OR the program lacks the access the user's key-handling layer requires. Re-check the matrix in ## Safety policy. |
DOCA_ERROR_AGAIN | doca_task_submit on either AES-GCM task type | The task queue is full. This is not a hardware error; the program must drain completions via doca_pe_progress() before re-submitting. Same as the cross-library "would-block, retry after progress" pattern. |
DOCA_ERROR_IO_FAILED (or equivalent device-reported error on the decrypt completion) | doca_aes_gcm_task_decrypt completion | Auth tag verification FAILED on decrypt. This is the security-relevant outcome: the ciphertext was tampered with or corrupted in transit / at rest. The plaintext output of this task is poisoned — do not consume it. Treat the input ciphertext as untrusted, log a security event, and route to the user's application-layer policy for tampered input. Do NOT silently retry. |
DOCA_ERROR_DRIVER | Any submit / completion call | The layer below DOCA reported failure. Capture state and route to env-class debug (doca-setup ## debug (doca-setup/TASKS.md#debug)) — the layer below DOCA is the suspect, not the AES-GCM program. |
The agent's rule: never recommend a retry loop on DOCA_ERROR_*
without first identifying which of the rows above is the cause.
_AGAIN is the only one that wants a retry (after
doca_pe_progress()); the others want investigation, not retry.
Tag-verification failure (the IO_FAILED-class row above) MUST NOT
be retried — a retry of the same ciphertext + key + IV + AAD will
fail the same way, and silently re-submitting hides the security
signal.
Observability
DOCA AES-GCM observability is event-driven, not poll-driven. Every submitted task produces a completion event on the DOCA Core progress engine; there are no AES-GCM-specific counters the way Flow has per-pipe counters.
Four primary signals the agent should reach for:
Task completion events on the PE. Every submitted AES-GCM task (encrypt or decrypt) produces a completion event when it finishes (or errors). The completion carries the
doca_error_tif it failed; the agent must inspect the per-task completion, not thedoca_task_submit()return value alone. Submitted but no completion is almost always a misseddoca_pe_progress()call in the user's main loop.Decrypt completion status — the security-critical signal. On
doca_aes_gcm_task_decryptcompletions specifically, the per-task completion result distinguishes "tag verified, plaintext is good" from "tag did NOT verify, plaintext is poisoned". The agent's observability rule: every decrypt completion must be inspected for this status before the plaintext is read; treating the absence of a system-level error as "success" misses the tampered-ciphertext case.Capability snapshot at configure time. The output of every
doca_aes_gcm_cap_*query is a snapshot of what the device's accelerator said was possible before any task was submitted. Save it as the baseline; if a task later returnsDOCA_ERROR_NOT_SUPPORTEDorDOCA_ERROR_INVALID_VALUEthe diff against this snapshot is the bug.Known-vector round-trip. The cheapest correctness signal is to encrypt + decrypt a small fixed input (a published AES-GCM test vector — NIST GCMVS or RFC 5288 example) with a known key + IV + AAD and compare against the published ciphertext + tag (on encrypt) and recovered plaintext (on decrypt). If the accelerator produces a different ciphertext or fails to recover the plaintext, the configuration is wrong; do not move on to bulk input.
For cross-cutting observability primitives (--sdk-log-level, the
doca-<lib>-trace build flavor, the DOCA_LOG_LEVEL env var) see
doca-debug CAPABILITIES.md ## Observability (doca-debug/CAPABILITIES.md#observability).
For the install-tree observability (logger names, package layout)
defer to
doca-public-knowledge-map/SKILL.md.
Safety policy
Overlay on the bundle-wide hardware-safety meta-policy. The rules below are this skill's per-artifact overlay on the cross-cutting rules in
doca-hardware-safetyCAPABILITIES.md ## Safety policy (doca-hardware-safety/CAPABILITIES.md#safety-policy) (specifically ### Per-artifact overlay pattern (doca-hardware-safety/CAPABILITIES.md#per-artifact-overlay-pattern)). When the two layers disagree, the stricter wins; when either layer says STOP, the agent stops.
DOCA AES-GCM's safety surface is buffer-permission discipline plus AEAD discipline plus key-handling discipline plus path-selection discipline. AES-GCM is authenticated encryption; an incorrect permission flag, a skipped tag check on decrypt, a leaked key, or the wrong choice of accelerator-vs-CPU each produces a distinct class of failure, and the agent's job is to verify all four before any submission.
The permission matrix the agent must walk for any new AES-GCM setup:
| Buffer | Minimum mmap permission | Class shape | Common over-broad mistake |
|---|---|---|---|
| Source (plaintext on encrypt / ciphertext on decrypt) | DOCA_ACCESS_FLAG_LOCAL_READ_ONLY | The accelerator only needs to read the input; granting write is unnecessary and a small attack-surface widening | Granting DOCA_ACCESS_FLAG_LOCAL_READ_WRITE "to keep things simple" — works, but the read-only flag is the safe minimum |
| Destination (ciphertext on encrypt / plaintext on decrypt) | DOCA_ACCESS_FLAG_LOCAL_READ_WRITE | The accelerator writes the output; the application reads it back | Reusing the source doca_mmap as the destination — fails at submit if the mmap is read-only; if both buffers share an mmap, the mmap must be read-write |
AEAD discipline — the rules the agent must surface every time.
AES-GCM is authenticated encryption. The output of encrypt is ciphertext PLUS an auth tag; the input to decrypt is ciphertext PLUS an expected auth tag. The agent must never describe AES-GCM as if it were AES-CTR (where there is no tag) or AES-CBC (where authentication is a separate HMAC). A response that surfaces only the ciphertext path and ignores the tag is wrong by construction.
AAD (additional authenticated data) is authenticated but not encrypted. When the user passes AAD on encrypt, the tag covers both the ciphertext and the AAD; on decrypt, the same AAD must be passed alongside the ciphertext and tag, or verification will fail. AAD is the slot for protocol headers, sequence numbers, or any context the receiver must be able to bind to the ciphertext.
Tag verification failure on decrypt is poisoned output. If
doca_aes_gcm_task_decryptreports a tag-verification failure on its completion (theIO_FAILED-class row in## Error taxonomyabove), the plaintext output of that task is not safe to consume. The ciphertext was tampered with or corrupted in transit / at rest; the right response is to discard the plaintext, treat the input as untrusted, log a security event, and route to the user's application-layer policy. A silent retry on the same ciphertext is wrong by construction — the failure is deterministic.
Key-handling discipline — operational rules, not key-management substance. Key management itself (generation, storage, rotation, distribution) is out of scope for this skill; it belongs to the user's KMS / HSM / sealed-storage system. The skill's only operational rules:
Do not log key bytes. Trace-level DOCA logging (
DOCA_LOG_LEVEL=trace) can be verbose; the agent must not recommend dumping the key buffer in user-side prints. If the agent is helping the user instrument their program, the length of the key is observable; the contents are not.Do not commit key bytes. Hard-coded keys in a sample diff are a leak waiting to happen; the agent's
## modifyworkflow MUST surface this as a hazard if the user pastes a key into a code edit.Treat the key buffer as sensitive memory. When the program is done with the key, zero it before free. The library does not own the key bytes; the user does.
Path-selection — when NOT to use doca-aes-gcm. Equally important:
Tiny one-shot encryption. A single 64-byte AES-GCM encrypt on the CPU (AES-NI) is faster than the DMA-to-accelerator setup. The agent should recommend doca-aes-gcm only when the input is ≥ a few KiB and sustained, or the input is already pinned in
doca_mmapmemory because another DOCA library produced it.Non-GCM AES modes. If the user wants AES-CBC, AES-CTR, or AES-XTS, the answer is CPU + OpenSSL (or another CPU library) — not this library. The agent must not invent
doca_aes_*_cbc/_ctr/_xtssymbols; this library covers GCM specifically.Authentication without encryption. If the user needs only a keyed hash for integrity (e.g. an HMAC over a plaintext payload), AES-GCM is the wrong tool. Route to
doca-sha/SKILL.mdfor hardware-accelerated SHA hashing, or to CPU HMAC.
The mmap must stay valid until the AES-GCM context is destroyed.
Destroying either the source or destination mmap before
doca_ctx_destroy() is a use-after-free on the library's
bookkeeping; symptoms include DOCA_ERROR_BAD_STATE from subsequent
calls and undefined behavior on outstanding tasks.
Validate against a known vector BEFORE bulk submission. A single known-vector smoke (one short input with a published key + IV + AAD
ciphertext + tag) catches key-size mis-selection, IV-length assumptions, AAD-binding bugs, and tag-length errors before they silently corrupt or poison a multi-GiB result.
Deferred topic boundaries
This skill scopes itself to the DOCA AES-GCM library. Adjacent topics the agent will get asked but should route elsewhere:
General AEAD / cryptography background (why GCM is preferred over CBC-then-HMAC, GCM nonce-reuse pitfalls beyond the API surface, the underlying GHASH construction, when to choose AES-GCM vs ChaCha20-Poly1305) — outside this skill. Route to upstream NIST / IETF cryptography documentation; this skill assumes the user already knows AES-GCM is the right primitive and is asking how to express it through the DOCA AES-GCM API.
Key management (key derivation functions, key rotation schedules, HSM integration, key escrow) — owned by the user's KMS / HSM stack, not this library. The skill's only contribution is the operational key-handling discipline in
## Safety policy.DOCA Core context and progress engine internals — owned by
doca-programming-guide/SKILL.md. This skill uses the Core context lifecycle; it does not redefine it.Cross-cutting
DOCA_ERROR_*taxonomy — owned bydoca-programming-guide CAPABILITIES.md ## Error taxonomy(doca-programming-guide/CAPABILITIES.md#error-taxonomy). This skill adds the AES-GCM overlay, not the taxonomy itself.Other DOCA crypto-acceleration libraries (DOCA SHA, DOCA Compress, DOCA DMA) — separate libraries with their own skills. Path-selection guidance in
## Capabilities and modesnames them; the deep per-library substance lives in the matching skill.Cross-library
doca_capsinvocation patterns — owned by the cross-librarydoca-capstool skill. This skill references the AES-GCM capability query family (doca_aes_gcm_cap_*), which is per-library; the cross-library capability snapshot tool (doca_caps --list-devs) is a separate surface.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
The author says: Requires DOCA SDK installed at /opt/mellanox/doca on Linux (Ubuntu 22.04/24.04 or RHEL/SLES) with a BlueField DPU or ConnectX NIC attached. Reads the local install via `pkg-config doca-aes-gcm` and inspects /opt/mellanox/doca/{lib,include,samples,applications}. Only `DOCA_AES_GCM_KEY_128` / `_256` are supported (not AES-192). The validation steps require a live DOCA install.
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- NVIDIA
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/doca-aes-gcm · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by NVIDIA or NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download doca-aes-gcm.zip