Hi all,

I recently opened draft PR #66969 [1] which introduces AEAD encryption to librbd to meet stricter security requirements.

Unlike the existing AES-XTS implementation (which preserves length), AEAD ciphers introduce a ciphertext expansion (e.g., a 4KB block becomes 4128 bytes: 4KB data + 32 bytes tag/IV).

The Challenge I need to store this auxiliary data (e.g. authentication tag) alongside the encrypted payload. Crucially, the data and its auth tag must be committed atomically; if they desynchronize, decryption becomes impossible. Since RADOS guarantees atomicity per object, I am evaluating the best intra-object layout to handle this expansion.

The Question I am looking for feedback on which data layout is preferable for the OSD/BlueStore backend. I am considering three options and have benchmarked them on a small development cluster. I would like some architectural validation regarding write amplification and compaction risks, as well as more benchmarking data.

Here are the candidate layouts:

Option 1: Inline Layout (Current PR Approach)

We append the 32-byte tag directly after every 4KB block.

Option 2: Split Layout (Data + Tail Metadata)

We write the 4KB encrypted blocks at their original aligned offsets and store the auth. tags in a reserved area at the end of the RADOS object. Similar to the dm-integrity approach.

Option 3: Hybrid Layout (Data + OMAP)

We write the 4KB aligned data to the object body and the 32-byte tag to the object's OMAP (RocksDB).

Benchmarking & Preliminary Verdict I created a small librados benchmark script [2] to benchmark these strategies.

I would appreciate it if anyone with deep knowledge of OSD/BlueStore write paths could weigh in or rbd or rados developers. Is the alignment loss in Option 1 acceptable, or should we rather pursue Option 2 or 3?

It would be crucial if others could run the benchmark script [2] and share the results with me to come to a data driven result. (The script creates RADOS objects, performs I/O, outputs 4 JSON result files, and cleans up. Default size is 16GB, but larger runs would be greatly appreciated).

Links: [1] PR: https://github.com/ceph/ceph/pull/66969 [2] Benchmark Script: https://gist.github.com/Greenpepper15/6a0a0eb1ce33645cfcb55b0be9a05a52

Thanks, David Mohren - Clyso