[FEATURE] Use fixed-work AES field transformations #3

Closed
opened 2026-10-14 13:37:52 +02:00 by erikinkinen · 2 comments
Owner

Problem and motivation

Encrypted filesystem workloads need predictable byte-transform cost, including debug and test builds. Specify AES substitutions and field multiplication with work that is independent of the input byte values while preserving existing ciphertext and storage formats.

Proposed behavior and scope

Derive the byte transformations independently from FIPS 197. Use bounded algebraic substitutions and fixed-width field operations, without indexed secret-dependent tables. Preserve the current AES and XTS interfaces, key-schedule erasure and disk compatibility. Coordinate LibFsCrypto, E2fsd and the Integration source graph after the implementation is complete.

Authority, security and reliability

The arithmetic receives only its existing key, block and tweak buffers; it adds no I/O, allocation, dependency or capability. Preserve ownership and erasure of schedules and temporary buffers. Correctness and review of generated code take precedence over speed. Fixed source-level work is not a claim of universal machine-level constant time.

Acceptance criteria

  • Document the independent mathematical derivation and keep all authored code below 1,000 lines with useful rustdoc.
  • Verify every byte substitution and inverse, field arithmetic and published AES/XTS vectors, including zero and boundary inputs.
  • Preserve ciphertext, round trips, key/tweak erasure and existing caller contracts.
  • Compare identical workloads under explicit finite budgets, inspect the relevant generated code, and complete formatting, strict Clippy and unit checks.
  • Adopt the implementation coherently in filesystem consumers and observe their complete original CI workloads without weakening deadlines or assertions.

Alternatives and tradeoffs

Tables can reduce arithmetic but introduce data-dependent memory accesses. Algebraic byte operations allow a direct derivation and a bounded operation sequence; compiler output still needs review on each supported target.

Tracking and rollout

Library audit, library PR, phase completion. Publish the reviewed library change first, then update its consumers and Integration catalogs together. No release or format migration is proposed.

## Problem and motivation Encrypted filesystem workloads need predictable byte-transform cost, including debug and test builds. Specify AES substitutions and field multiplication with work that is independent of the input byte values while preserving existing ciphertext and storage formats. ## Proposed behavior and scope Derive the byte transformations independently from [FIPS 197](https://csrc.nist.gov/pubs/fips/197/final). Use bounded algebraic substitutions and fixed-width field operations, without indexed secret-dependent tables. Preserve the current AES and XTS interfaces, key-schedule erasure and disk compatibility. Coordinate LibFsCrypto, E2fsd and the Integration source graph after the implementation is complete. ## Authority, security and reliability The arithmetic receives only its existing key, block and tweak buffers; it adds no I/O, allocation, dependency or capability. Preserve ownership and erasure of schedules and temporary buffers. Correctness and review of generated code take precedence over speed. Fixed source-level work is not a claim of universal machine-level constant time. ## Acceptance criteria - [x] Document the independent mathematical derivation and keep all authored code below 1,000 lines with useful rustdoc. - [x] Verify every byte substitution and inverse, field arithmetic and published AES/XTS vectors, including zero and boundary inputs. - [x] Preserve ciphertext, round trips, key/tweak erasure and existing caller contracts. - [x] Compare identical workloads under explicit finite budgets, inspect the relevant generated code, and complete formatting, strict Clippy and unit checks. - [x] Adopt the implementation coherently in filesystem consumers and observe their complete original CI workloads without weakening deadlines or assertions. ## Alternatives and tradeoffs Tables can reduce arithmetic but introduce data-dependent memory accesses. Algebraic byte operations allow a direct derivation and a bounded operation sequence; compiler output still needs review on each supported target. ## Tracking and rollout [Library audit](https://git.erikinkinen.fi/erix/lib-aes/issues/1), [library PR](https://git.erikinkinen.fi/erix/lib-aes/pulls/2), [phase completion](https://git.erikinkinen.fi/erix/integration/issues/65). Publish the reviewed library change first, then update its consumers and Integration catalogs together. No release or format migration is proposed.
Author
Owner

The arithmetic change is published in aed2eef2aa74114323e405a23b99513e723b4661, with matching LibFsCrypto, E2fsd and Integration selections. It preserves ciphertext and the existing interfaces. The selected x86-64 compiler output has also been reviewed; this does not establish constant time on every target.

AES and LibFsCrypto pass their original push workflows. E2fsd now completes the formerly stalled crypto cases, but its workflow exposes a separate checker-image race. The final consumer criterion remains open until that workflow completes.

The arithmetic change is published in `aed2eef2aa74114323e405a23b99513e723b4661`, with matching LibFsCrypto, E2fsd and Integration selections. It preserves ciphertext and the existing interfaces. The selected x86-64 compiler output has also been reviewed; this does not establish constant time on every target. AES and LibFsCrypto pass their original push workflows. E2fsd now completes the formerly stalled crypto cases, but its workflow exposes a separate [checker-image race](https://git.erikinkinen.fi/erix/e2fsd/issues/24). The final consumer criterion remains open until that workflow completes.
Author
Owner

The fixed-work arithmetic is implemented and adopted by LibFsCrypto and E2fsd. The remaining consumer criterion is complete: E2fsd CI 415 passes its original encrypted workloads after the separate checker fixture repair. Integration selects the repaired consumer. Closing this implementation issue; the broader library audit remains open.

The fixed-work arithmetic is implemented and adopted by LibFsCrypto and E2fsd. The remaining consumer criterion is complete: [E2fsd CI 415](https://git.erikinkinen.fi/erix/e2fsd/actions/runs/415) passes its original encrypted workloads after the separate [checker fixture repair](https://git.erikinkinen.fi/erix/e2fsd/issues/24). Integration selects the repaired consumer. Closing this implementation issue; the broader library audit remains open.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:34:34 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/lib-aes#3
No description provided.