# KMS Performance Comparison

**Versions**: `v5.29.0`  
**Generated**: 2026-11-20

---

## Benchmark Environment

| Field | Value |
|---|---|
| Date | 2026-11-20 09:54:53 UTC |
| HSM backend | None (Software) |
| Command | `mise run bench:load` |
| Build | release / non-fips |
| Database | SQLite (temporary, single benchmark run) |
| CPU | AMD EPYC 7R13 Processor @ 3,516 MHz |
| CPU cores | 2 physical / 4 logical (HT) |
| RAM | 7.0 GB |
| OS | Ubuntu 24.04.4 LTS |
| Kernel | 7.0.0-1014-aws |

### Load test parameters

| Parameter | Value |
|---|---|
| Mode | all |
| Protocols | all |
| Measurement window | 20 s per concurrency level |
| Concurrency levels | 1,2,4,8,16 |
| Warm-up | 5 s |
| Cooldown between levels | 2 s |

### CPU detail (`lscpu`)

```text
Architecture:                            x86_64
CPU op-mode(s):                          32-bit, 64-bit
Address sizes:                           48 bits physical, 48 bits virtual
Byte Order:                              Little Endian
CPU(s):                                  4
On-line CPU(s) list:                     0-3
Vendor ID:                               AuthenticAMD
Model name:                              AMD EPYC 7R13 Processor
CPU family:                              25
Model:                                   1
Thread(s) per core:                      2
Core(s) per socket:                      2
Socket(s):                               1
Stepping:                                1
BogoMIPS:                                5300.00
Flags:                                   fpu vme de pse tsc msr pae mce cx8 apic sep pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid extd_apicid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch topoext ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr wbnoinvd arat npt nrip_save vaes vpclmulqdq rdpid
Hypervisor vendor:                       KVM
Virtualization type:                     full
L1d cache:                               64 KiB (2 instances)
L1i cache:                               64 KiB (2 instances)
L2 cache:                                1 MiB (2 instances)
L3 cache:                                8 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-3
Vulnerability Gather data sampling:      Not affected
Vulnerability Ghostwrite:                Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Old microcode:             Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Mitigation; Safe RET
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Mitigation; Clear CPU buffers
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
```


---

## Architecture

```mermaid
graph TB
    subgraph cli["Local: ckms CLI"]
        ckms["<b>ckms load</b><br/>(concurrent load driver)"]
    end
    
    subgraph srv["KMS Server"]
        kmip["KMIP 2.1<br/>(HTTP/TLS)"]
        crypto["Software Crypto<br/>(OpenSSL 3.6.5)"]
        db["Key Storage<br/>(SQLite/PostgreSQL)"]
    end
    
    ckms -->|HTTP/TLS| kmip
    kmip --> crypto
    crypto --> db
    
    style ckms fill:#4A90E2
    style kmip fill:#7ED321
    style crypto fill:#F5A623
    style db fill:#BD10E0
```

**Components**:
- **ckms**: Configurable concurrent load generator (ops/sec sweep)
- **KMIP Endpoint**: Protocol handler for request/response marshaling
- **Software Crypto**: AES-GCM, RSA-PKCS, ECDSA-P256, EdDSA-Ed25519 via OpenSSL 3.6.5
- **Key Storage**: Key material persistence (SQLite or PostgreSQL)



---

## Protocols

The KMS server was exercised over three distinct wire protocols.
Each benchmark column is labelled with the protocol name it used.

| Protocol | Transport | Encoding | Endpoint | Description |
|---|---|---|---|---|
| **ttlv-json** | HTTP/1.1 | KMIP 2.1 JSON-TTLV | `POST /kmip/2_1` | Primary interoperability protocol — any KMIP 2.1 compliant client can use it |
| **ttlv-bytes** | HTTP/1.1 | KMIP 2.1 binary TTLV | `POST /kmip` | Binary wire format; eliminates JSON parsing overhead — typically 10–30 % faster |
| **jose** | HTTP/1.1 | JWE / JWS (JOSE) | `POST /v1/crypto/` | REST API for OAuth2/OIDC workloads that prefer JWA algorithm identifiers over KMIP |

**KMIP TTLV** (Tag-Type-Length-Value) is the native encoding of the KMIP 2.1 standard (OASIS KMIP Spec v2.1, §9.1). The **JSON** variant wraps every field in a `{"tag": …, "type": …, "value": …}` JSON object and base64-encodes binary values. The **binary** variant uses a compact 8-byte fixed header (3-byte tag, 1-byte type, 4-byte length) per value, removing JSON tokenisation, base64, and UTF-8 overhead entirely.

**JOSE** (JSON Object Signing and Encryption, RFC 7516 / RFC 7515) exposes KMS key material through `/v1/crypto/` REST endpoints. It is used by cloud integrations (Google CSE, Microsoft DKE, Azure EKM) and any workload that speaks JWA algorithm identifiers (A256GCM, RS256, ES384 …) rather than KMIP semantics.


---

## Benchmark Methodology

### Plaintext / payload sizes

All encrypt/decrypt benchmarks use a **fixed-size random payload**. Sizes represent a realistic key-wrapping or small-message encryption workload without introducing significant data-transfer overhead on a loopback connection.

| Algorithm / category | Plaintext size | Notes |
|---|---|---|
| AES-GCM (128 / 192 / 256-bit key) | 64 bytes | FIPS 140-3 |
| AES-GCM-SIV (128 / 256-bit key) | 64 bytes | Non-FIPS |
| AES-XTS (128 / 256-bit AES = 256 / 512-bit key) | 64 bytes | FIPS 140-3; requires 16-byte IV |
| ChaCha20-Poly1305 (256-bit key) | 64 bytes | Non-FIPS |
| ECIES — P-256 / P-384 / P-521 | 64 bytes | Non-FIPS; EC public-key encryption |
| Salsa Sealed Box (X25519) | 64 bytes | Non-FIPS |
| Covercrypt (attribute-based encryption) | 64 bytes | Non-FIPS |
| JOSE JWE — `dir` + AES-GCM (A128GCM / A192GCM / A256GCM) | 64 bytes | Symmetric (direct key agreement) |
| JOSE JWE — RSA-OAEP + AES-GCM (2048 / 4096-bit) | 64 bytes | Asymmetric (RSA-OAEP CEK wrapping) |
| RSA-OAEP (2048 / 3072 / 4096-bit) | 32 bytes | Limited by RSA block size |
| RSA-PKCS#1 v1.5 (2048 / 3072 / 4096-bit) | 32 bytes | Non-FIPS |
| RSA-AES Key Wrap — KWP (2048 / 3072 / 4096-bit) | 32 bytes | FIPS 140-3 |
| Sign / Verify — all algorithms | 32 bytes | Message is hashed internally |
| JOSE JWS / MAC | 32 bytes | |

### Load test (`mise run bench:load`)

The load test sweeps a configurable list of concurrency levels. At each level *N* concurrent async tasks send pre-serialised requests in tight loops for a fixed **measurement window** (default: 20 s), preceded by a **warm-up phase** (default: 5 s) that is excluded from measurements. Pre-serialisation happens once at setup time and the same bytes are reused on every iteration, isolating server-side KMS latency from client-side encoding overhead.
Recorded metrics per *(protocol, operation, concurrency)* triple:

- **Throughput** — requests per second (req/s)
- **p50 / p95 / p99** — round-trip latency percentiles (ms)

### Criterion micro-benchmarks (`ckms bench`)

Criterion (Rust, v0.5) measures the **round-trip latency of a single request** from the ckms client library through the KMS server and back over a loopback TCP connection. The server is started once and kept alive across all benchmarks in the suite.
The reported value is the **mean ± 95 % confidence interval** over a configurable number of samples (preset `quick`: 3 s warm-up + 5 s measurement per benchmark).

> **Infrastructure note:** Both test types use a **local SQLite** backend (temporary, discarded after the run). This isolates pure cryptographic and KMIP serialisation overhead from database I/O. Throughput figures will differ on a production deployment backed by PostgreSQL or Redis-Findex.


---

## Load Tests

### encrypt/aes-gcm

| Concurrency | ttlv-json (req/s) | ttlv-bytes (req/s) | jose (req/s) |
|---|---|---|---|
| 1 | 697 | 833 | 1,698 |
| 2 | 1,377 | 1,641 | 3,124 |
| 4 | 3,798 | 4,492 | 10,894 |
| 8 | 4,210 | 5,470 | 10,971 |
| 16 | 4,230 | 5,628 | 11,215 |

![Throughput — encrypt/aes-gcm](load/encrypt_aes-gcm.svg)

---

### decrypt/rsa-oaep-cached

| Concurrency | jose (req/s) |
|---|---|
| 1 | 1,551 |
| 2 | 2,858 |
| 4 | 9,332 |
| 8 | 9,441 |
| 16 | 9,606 |

![Throughput — decrypt/rsa-oaep-cached](load/decrypt_rsa-oaep-cached.svg)

---

### decrypt/rsa-oaep-fresh

| Concurrency | jose (req/s) |
|---|---|
| 1 | 20 |
| 2 | 38 |
| 4 | 42 |
| 8 | 42 |
| 16 | 42 |

![Throughput — decrypt/rsa-oaep-fresh](load/decrypt_rsa-oaep-fresh.svg)

---

### sign-verify/ecdsa-p256

| Concurrency | ttlv-json (req/s) | ttlv-bytes (req/s) | jose (req/s) |
|---|---|---|---|
| 1 | 789 | 812 | 1,492 |
| 2 | 1,576 | 1,593 | 2,647 |
| 4 | 4,391 | 4,459 | 8,890 |
| 8 | 5,346 | 5,461 | 9,002 |
| 16 | 5,501 | 5,646 | 9,105 |

![Throughput — sign-verify/ecdsa-p256](load/sign-verify_ecdsa-p256.svg)

---

### sign-verify/eddsa-ed25519

| Concurrency | ttlv-json (req/s) | ttlv-bytes (req/s) | jose (req/s) |
|---|---|---|---|
| 1 | 808 | 816 | 1,531 |
| 2 | 1,604 | 1,635 | 2,763 |
| 4 | 4,570 | 4,572 | 8,603 |
| 8 | 5,570 | 5,647 | 9,314 |
| 16 | 5,689 | 5,825 | 9,388 |

![Throughput — sign-verify/eddsa-ed25519](load/sign-verify_eddsa-ed25519.svg)

---

### sign-verify/ecdsa-secp256k1

| Concurrency | ttlv-json (req/s) | ttlv-bytes (req/s) |
|---|---|---|
| 1 | 521 | 525 |
| 2 | 985 | 985 |
| 4 | 2,103 | 2,121 |
| 8 | 2,216 | 2,234 |
| 16 | 2,236 | 2,263 |

![Throughput — sign-verify/ecdsa-secp256k1](load/sign-verify_ecdsa-secp256k1.svg)

---

### key-creation/aes-sym

| Concurrency | ttlv-json (req/s) |
|---|---|
| 1 | 485 |
| 2 | 606 |
| 4 | 564 |
| 8 | 549 |
| 16 | 534 |

![Throughput — key-creation/aes-sym](load/key-creation_aes-sym.svg)

---

### batch/aes-gcm-10

| Concurrency | ttlv-json (req/s) |
|---|---|
| 1 | 255 |
| 2 | 484 |
| 4 | 847 |
| 8 | 837 |
| 16 | 839 |

![Throughput — batch/aes-gcm-10](load/batch_aes-gcm-10.svg)

---

## Criterion Benchmarks

### Symmetric Encryption

| Benchmark | ttlv-json | ttlv-bytes | jose |
|---|---|---|---|
| aes-gcm-siv/decrypt/128 | 1.62 ms | 1.68 ms | — |
| aes-gcm-siv/decrypt/256 | 1.80 ms | 1.66 ms | — |
| aes-gcm-siv/encrypt/128 | 1.67 ms | 1.73 ms | — |
| aes-gcm-siv/encrypt/256 | 1.72 ms | 1.65 ms | — |
| aes-gcm/decrypt/128 | 1.67 ms | 1.70 ms | 1.04 ms |
| aes-gcm/decrypt/192 | 1.75 ms | 1.66 ms | 1.14 ms |
| aes-gcm/decrypt/256 | — | — | 1.15 ms |
| aes-gcm/encrypt/128 | 1.73 ms | 1.78 ms | 1.12 ms |
| aes-gcm/encrypt/192 | 1.67 ms | 1.64 ms | 1.20 ms |
| aes-gcm/encrypt/256 | 1.79 ms | 1.71 ms | 1.14 ms |
| aes-xts/decrypt/128 | 1.74 ms | 1.72 ms | — |
| aes-xts/decrypt/256 | 1.74 ms | 1.70 ms | — |
| aes-xts/encrypt/128 | 1.64 ms | 1.67 ms | — |
| aes-xts/encrypt/256 | 1.74 ms | 1.69 ms | — |
| chacha20-poly1305/decrypt/256 | 1.66 ms | 1.66 ms | — |
| chacha20-poly1305/encrypt/256 | 1.67 ms | 1.67 ms | — |
| salsa-sealed-box/decrypt | 1.93 ms | 1.88 ms | — |
| salsa-sealed-box/encrypt | 1.96 ms | 1.88 ms | — |


---

### Asymmetric Encryption

| Benchmark | ttlv-json | ttlv-bytes | jose |
|---|---|---|---|
| covercrypt/decrypt | 26.90 ms | 28.70 ms | — |
| covercrypt/encrypt | 12.53 ms | 13.02 ms | — |
| ecies/decrypt/P-256 | 1.95 ms | 1.85 ms | — |
| ecies/decrypt/P-384 | 4.06 ms | 4.12 ms | — |
| ecies/encrypt/P-256 | 1.93 ms | 1.95 ms | — |
| ecies/encrypt/P-384 | 4.11 ms | 4.14 ms | — |
| ecies/encrypt/P-521 | 7.01 ms | 7.05 ms | — |
| rsa-aes-kwp/decrypt/4096 | 343.35 ms | 349.08 ms | — |
| rsa-aes-kwp/encrypt/4096 | 1.92 ms | 1.94 ms | — |
| rsa-oaep/decrypt/2048 | — | — | 1.20 ms |
| rsa-oaep/decrypt/4096 | 341.16 ms | 342.19 ms | 1.22 ms |
| rsa-oaep/encrypt/2048 | — | — | 1.28 ms |
| rsa-oaep/encrypt/4096 | 1.96 ms | 1.78 ms | 1.44 ms |
| rsa-pkcs1v15/decrypt/4096 | 349.18 ms | 340.54 ms | — |
| rsa-pkcs1v15/encrypt/4096 | 1.96 ms | 1.89 ms | — |


---

### Key Encapsulation (KEM)

| Benchmark | ttlv-json | ttlv-bytes |
|---|---|---|
| configurable/decapsulate/ML-KEM-512 | 2.07 ms | 2.03 ms |
| configurable/decapsulate/ML-KEM-768 | 2.08 ms | 2.14 ms |
| configurable/encapsulate/ML-KEM-512 | 1.99 ms | 1.98 ms |
| configurable/encapsulate/ML-KEM-512/P-256 | 2.30 ms | 2.20 ms |
| configurable/encapsulate/ML-KEM-768 | 2.00 ms | 2.09 ms |
| pqc/decapsulate/ML-KEM-512 | 1.84 ms | 1.87 ms |
| pqc/decapsulate/ML-KEM-768 | 2.00 ms | 1.89 ms |
| pqc/encapsulate/ML-KEM-1024 | 1.91 ms | 1.94 ms |
| pqc/encapsulate/ML-KEM-512 | 1.89 ms | 1.89 ms |
| pqc/encapsulate/ML-KEM-768 | 1.86 ms | 1.85 ms |


---

### Key Creation

| Benchmark | ttlv-json |
|---|---|
| EC/ES256 | — |
| EC/ES384 | — |
| RSA/2048 | — |
| aes-gcm/oct/128 | — |
| aes-gcm/oct/256 | — |
| covercrypt/master-keypair | 55.26 ms |
| ec/ed25519 | 3.14 ms |
| ec/ed448 | 3.43 ms |
| ec/p256 | 2.91 ms |
| ec/p384 | 4.47 ms |
| ec/p521 | 6.06 ms |
| kem/ML-KEM-512 | 4.16 ms |
| kem/ML-KEM-512/P-256 | 3.41 ms |
| kem/ML-KEM-512/X25519 | 7.22 ms |
| kem/ML-KEM-768 | 3.63 ms |
| kem/ML-KEM-768/P-256 | 3.84 ms |
| pqc/ML-KEM-1024 | 4.15 ms |
| pqc/ML-KEM-512 | 3.81 ms |
| pqc/ML-KEM-768 | 3.84 ms |
| pqc/X25519MLKEM768 | 3.57 ms |
| pqc/X448MLKEM1024 | 3.86 ms |
| rsa/rsa-4096 | 501.28 ms |
| symmetric/aes-128 | 2.64 ms |
| symmetric/aes-192 | 2.53 ms |
| symmetric/aes-256 | 2.55 ms |
| symmetric/chacha20-256 | 2.56 ms |


---

### Sign / Verify

| Benchmark | ttlv-json | ttlv-bytes | jose |
|---|---|---|---|
| ecdsa-p256/sign | 1.75 ms | 1.90 ms | 1.28 ms |
| ecdsa-p256/verify | 1.94 ms | 1.91 ms | 1.93 ms |
| ecdsa-p384/sign | 4.16 ms | 4.08 ms | 3.71 ms |
| ecdsa-p384/verify | 2.95 ms | 2.97 ms | 2.77 ms |
| ecdsa-p521/sign | 7.02 ms | 7.20 ms | — |
| ecdsa-p521/verify | 4.19 ms | 4.08 ms | — |
| ecdsa-secp256k1/sign | 2.68 ms | 2.40 ms | — |
| ecdsa-secp256k1/verify | 2.47 ms | 2.44 ms | — |
| eddsa-ed25519/sign | 1.80 ms | 1.89 ms | 1.27 ms |
| eddsa-ed25519/verify | 1.91 ms | 1.91 ms | 1.88 ms |
| eddsa-ed448/sign | 2.43 ms | 2.21 ms | — |
| eddsa-ed448/verify | 2.06 ms | 2.04 ms | — |
| ml-dsa/sign/44 | 2.94 ms | 2.88 ms | — |
| ml-dsa/sign/65 | 3.56 ms | 3.65 ms | — |
| ml-dsa/sign/87 | 4.20 ms | 3.76 ms | — |
| ml-dsa/verify/44 | 2.08 ms | 1.95 ms | — |
| ml-dsa/verify/65 | 2.14 ms | 1.99 ms | — |
| rsa-pkcs1v15/sign | — | — | 51.30 ms |
| rsa-pkcs1v15/verify | — | — | 1.76 ms |
| rsa-pss/sign | — | — | 51.02 ms |
| rsa-pss/sign/4096 | 341.14 ms | 352.08 ms | — |
| rsa-pss/verify | — | — | 1.68 ms |
| rsa-pss/verify/4096 | 1.93 ms | 1.82 ms | — |
| slh-dsa/sign/SHA2-128f | 20.11 ms | 20.28 ms | — |
| slh-dsa/sign/SHA2-256f | 74.36 ms | 66.35 ms | — |
| slh-dsa/sign/SHAKE-128f | 53.61 ms | 51.52 ms | — |
| slh-dsa/verify/SHA2-128f | 3.65 ms | 3.06 ms | — |
| slh-dsa/verify/SHA2-256f | 5.35 ms | 3.98 ms | — |


---

