Skip to content

Apache Iggy encrypts streams with rind - #474

Closed
kixelated wants to merge 2 commits into
mainfrom
quest/m2/adoption/iggy
Closed

kixelated wants to merge 2 commits into
mainfrom
quest/m2/adoption/iggy

Conversation

@kixelated

@kixelated kixelated commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Claims quest/m2/adoption/iggy.md.

The Apache Iggy patch is built, tested, and benchmarked. Nothing was posted to apache/iggy. Iggy wants an approved issue assigned to the PR's author before any code, with the rationale in that person's own words, so opening it is the maintainer's step. This PR only rewrites the quest to what remains.

Waiting

  • Maintainer: open the apache/iggy issue in your own words from the facts below (recommended), or drop the quest. An agent can't: Iggy's CONTRIBUTING lets maintainers close agent-driven PRs without review, and wants the author to explain every line and answer review themselves. Check with gh issue list -R apache/iggy --author @me --search rind. Once you're assigned, open the PR from the patch (git am), filling in Iggy's PR template, including its AI Usage section.

The patch

patches/1-rind.patch on the scratch/iggy-bench branch, one commit on apache/iggy 1fb58a6. Delete that branch once the Iggy PR is open.

  • iggy_common's Aes256GcmEncryptor (the SDK's and CLI's client-side encryption) and the server's stream-key envelope (KeyEncryptionKey) seal and open with rind::aead::AES_256_GCM. Nonces come from rind::rand::fill.
  • aes-gcm drops to a dev-dependency, kept for the bench's raw row and for two new tests showing that payloads and envelopes sealed by aes-gcm open under rind and the other way round, so stored data and old clients keep working. aes-gcm-siv is untouched.
  • Public API unchanged. rind's Key isn't Clone, so it sits behind an Arc. That made the GCM variant 8 bytes next to SIV's 480, so EncryptorKind takes #[allow(clippy::large_enum_variant)], as two other Iggy enums already do. The alternative, dropping Clone, would break the API.
  • Commit message carries a Co-Authored-By: Claude Opus 5.5 trailer, which the ASF generative-tooling guidance recommends.

Facts for the issue

Facts only; Iggy wants the rationale in the author's words.

  • Iggy's AES-256-GCM paths: client-side encryption (EncryptorKind::Aes256Gcm, the CLI's --encryption-key) and the stream-key envelope. Per-stream server-side encryption from apache/iggy#4615 uses AES-256-GCM-SIV, which rind lacks and which this change leaves alone.

  • stream_encryption bench, current-wrapper row (Aes256GcmEncryptor), median of 3 interleaved runs pinned to one core on GitHub runners (run), encrypt / decrypt ns per op:

    bytes x86_64 (Xeon 8573C) before after arm64 (Neoverse N2) before after
    64 522 / 136 453 / 52 498 / 115 447 / 59
    1 KiB 832 / 418 553 / 120 987 / 562 729 / 354
    16 KiB 5540 / 4758 1770 / 1333 8218 / 7350 4696 / 4261
    1 MiB 395k / 327k 111k / 110k 538k / 497k 286k / 284k

    Up to 3.6x faster on x86_64 and 1.9x on arm64. The raw RustCrypto rows, built the same both times, moved under 7% across all six runs while the wrapper moved up to 3.6x.

  • At 64 bytes, encrypting is mostly the per-message getrandom nonce: RustCrypto's in-place seal takes 128 ns, its whole encrypt-with-nonce 506 ns.

  • The cipher alone, sealing in place (local-only comparison bench, not in the patch), ns at 64 B / 16 KiB: x86_64 RustCrypto 128 / 4763, ring 77 / 2020, rind 46 / 1216. arm64 RustCrypto 138 / 6721, ring 71 / 5267, rind 61 / 4022. iggy_common already links ring, so a reviewer may ask why not ring. rind is 1.3x to 1.7x faster than ring at 16 KiB.

  • Same bench run, for context: the SIV wrapper encrypts 16 KiB in 5094 ns (x86_64) and 7822 ns (arm64), about where the old GCM wrapper was, so after this change it runs 2.9x and 1.7x slower than GCM.

  • Platforms: rind builds only on x86_64, aarch64, and 32-bit arm, and fails to compile elsewhere. Iggy ships x86_64 and aarch64 wheels and binaries, but iggy_common sits under the crates.io iggy SDK, so an SDK user on another architecture would lose the build.

  • Licenses: rind is (Apache-2.0 OR ISC OR MIT-0) AND (Apache-2.0 OR ISC OR MIT) AND Apache-2.0 AND ISC AND BSD-3-Clause, all within about.toml's accepted list. On x86_64 and aarch64 it compiles only cfg-if and getrandom. Cargo.lock gains 20 entries that Iggy never builds: rind's armv7 backend (libcrux, hax-lib, fiat-crypto, curve25519-dalek 5) and its test-only crabgrind feature (bindgen).

Validation

Against apache/iggy 1fb58a6, with rustc 1.98.1 (Iggy pins 1.99.1, which I don't have locally):

  • cargo test -p iggy_common --lib: 523 passed, including the 2 new compatibility tests.
  • cargo test -p iggy --lib: 760 passed.
  • cargo fmt --all; cargo clippy -p iggy_common --no-deps --all-features --all-targets -- -D warnings: clean. The full-workspace clippy stops on clippy::too_long_first_doc_paragraph in iggy_binary_protocol, which this patch doesn't touch; it's likely a 1.98-vs-1.99.1 lint difference.
  • Not run: prek, cargo sort, cargo machete, taplo, typos, the license-header and third-party-license scripts, and the Docker-backed integration tests. Iggy wants prek run and a local run before the PR opens, so whoever opens it runs them.
  • Patch reviewed by Codex gpt-6.1-sol at medium effort (quest review --size S, round 1): score 10, no findings. Record skipped, since there is no PR for it.
  • rind side: just check passes. quest check: 146 documents ok.

Choices made without asking

  • The stream-key envelope moved to rind too, not just message encryption, so iggy_common has one AES-GCM implementation. aes-gcm stays as a dev-dependency for the bench comparison and the compatibility tests.
  • Numbers come from GitHub's runners through a scratch-branch probe, not the shared hosts: nixos was at load 86 and desktop was unreachable.
  • The patch lives on scratch/iggy-bench rather than a fork of apache/iggy, so nothing gets created outside moq-dev.

Suggested follow-ups

  • Plan, once Iggy accepts this swap: AES-256-GCM-SIV in rind. Iggy's per-stream server encryption runs SIV on every message, and after this change SIV is its slowest AEAD in this bench, so that's where rind would matter most to Iggy. Without Iggy's interest, no consumer needs it yet.
  • Plan: keep rind's test-only crabgrind dependency out of consumers' lockfiles. Every adoption PR's Cargo.lock picks up bindgen and clang-sys from it, which reviewers who audit dependencies will question.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, high effort

Review

Not run on this branch: it only rewrites the quest, and the PR stays a draft until the maintainer acts.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with high)

kixelated and others added 2 commits November 7, 2026 00:13
Quest-Claim: 0a9138ef58d17faa
…s issue

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Closing: the maintainer dropped this quest on 2026-11-07 (let projects pull rind rather than send them patches). moq-dev/rind#471 deletes it with the others.

(Written by Claude Opus 5.5 with high)

@kixelated kixelated closed this Nov 7, 2026
@kixelated
kixelated deleted the quest/m2/adoption/iggy branch November 7, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant