Repository navigation
fix: use native AES-CFB8 for ARM32 processes - #7
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
On a 32-bit ARM process, .NET does not expose the ARM AES intrinsics used by UMPK. The existing fallback encrypts a complete AES block in managed code for every CFB8 byte. Select the platform AES-CFB8 provider for
Architecture.Armand process whole buffers through it. Linux uses OpenSSL. Preserve the continuous ciphertext feedback register across calls, including short buffers and in-place decryption, and dispose native cipher resources within each call.Keep the existing intrinsic/software selection for other architectures and preserve
forceSoftware: true. Add 17 regression cases for selection, NIST vectors, fragmented streams, in-place operations, shared feedback, output bounds, and key/IV ownership. The test-count baseline increases by exactly those 17 cases.Prepare UMPK
0.9.0-beta.5by updating the shared build version, current install examples, version documentation, bug-report example, and changelog. Historical release entries retain their original versions.Versions affected
Encrypted Java sessions in ARM32 processes use the new backend. AES-CFB8 is shared across the supported protocols; this change adds no version-specific wire behavior. Live feature tests ran on vanilla 26.1 (775) and 26.2 (776). The ARM32 encrypted traffic check uses vanilla 26.1 (775).
Evidence
3872a7f07a1a595e651aef8b058dfc2bb3772f46; 26.2823e2250d24b3ddac457a60c92a6a941943fcd6a.Validation
Build and full regression validation were rerun on commit
970053f0abf6ea6531f939b11d1f8c08b8859d1aafter the version bump. The focused crypto, full formatting, dataset, generated-output, and live-server checks ran on AES commit9a4b0f0531f6f1c6282cff5680771dced66fc791, against mastera2c5e1e. The version commit changes metadata, comments, and documentation. Commands used SDK 10.0.401 at/tmp/mcc-skills-sdk/dotnet, throughrtk proxy.Build: zero warnings/errors. Focused crypto tests: 45 passed. Full suite: 12,579 passed, 7 skipped, no failures; all 17 suite totals match the baseline. Formatting passed. Dataset and language checks passed for 50 protocols. All 60 regenerated files are byte-identical to the checkout. The seven default skips comprise six opt-in live tests and the citation check requiring decompiled vanilla trees.
Release packaging passed using the shared version without a command-line version override. The verifier checked all 14 primary packages, 13 symbol packages, internal dependency versions, release-note URLs, and package metadata against
0.9.0-beta.5. All 16 source projects' assembly informational versions carry0.9.0-beta.5plus commit metadata. Formatting of the changed C# documentation passed after the bump.Real vanilla servers ran sequentially through
Umpk.IntegrationTests.LiveServerTests.FullFeatureLeg, with fresh temporary worlds, a 1 GiB heap, loopback port 25599, and/usr/bin/java(OpenJDK 27). Both legs passed chunks/world decoding, movement, chat in both directions, inventory, effects, entity metadata/attack, block placement/digging, chest open/content/server-confirmed quick-move, commands, 60-second keep-alive survival, and disconnect.An actual self-contained
linux-armprocess under QEMU selected the native backend automatically and passed the NIST vector, one-byte/in-place feedback checks, and 1 MiB streaming equality checks in both directions. The native path took about 132–138 ms/MiB versus about 9,982–10,005 ms/MiB for the scalar path in that emulator. These are emulated measurements, not physical-device throughput.The additional encrypted live probe used the PR's ARM32 client binary, synthetic session credentials, an AES-128-CFB8 loopback gateway on port 25620, and a real offline vanilla 26.1 backend on port 25619, started by
LocalServer. One run decoded 101 chunks in 9.23 seconds and completed inventory, bidirectional chat, effects, command-tree, movement-send, and server-confirmed digging checks. The intended 80-second survival check did not complete: QEMU aborted withthumb_tr_translate_insn: Assertion '(dc->base.pc_next & 1) == 0' failed. The fault also occurred with QEMU 10.0.13, a different CPU model, and runtime mapping/tiering options. These are incomplete emulator runs, not passing ARM32 live-session results. No production workaround for the emulator was added.dotnet build UMPK.slnpasses with no warnings.engineering/testcounts/expected_counts.json.dotnet format --verify-no-changespasses.Notes for reviewers
IsHardwareAcceleratedcontinues to describe UMPK's intrinsic implementation. It returns false for the ARM32 platform provider because OpenSSL's acceleration is not exposed through that property. There are no package dependencies or public API additions. Transport teardown after a failed send is separate follow-up work. Physical ARM32 hardware was unavailable; the full 50-version live matrix was not run.