Correct CBC-CS3 ciphertext stealing #11

Manually merged
erikinkinen merged 1 commit from feature/cbc-cs3 into feature/aes-key-erasure 2026-11-13 20:52:09 +01:00
Owner

Correct both directions of CBC-CS3, including partial chaining and the unconditional final complete-block exchange. Single-block inputs and the separate ordinary-CBC API keep their defined behavior. No legacy-format fallback is added.

Fixes #10. Depends on #7. The format and vector provenance explain the stored-byte compatibility correction.

  • Correct partial encryption and ciphertext reconstruction during decryption.
  • Exchange the final complete blocks on aligned inputs.
  • Check both directions against 49 independent fixed answers and preserve short-buffer refusal.
  • Complete the original strict debug/release component gates at this head.
  • Link the matching filesystem caller and interoperability controls.
Correct both directions of CBC-CS3, including partial chaining and the unconditional final complete-block exchange. Single-block inputs and the separate ordinary-CBC API keep their defined behavior. No legacy-format fallback is added. Fixes #10. Depends on #7. The [format and vector provenance](https://git.erikinkinen.fi/erix/lib-aes/src/branch/feature/cbc-cs3/docs/cbc-cs3.md) explain the stored-byte compatibility correction. - [x] Correct partial encryption and ciphertext reconstruction during decryption. - [x] Exchange the final complete blocks on aligned inputs. - [x] Check both directions against 49 independent fixed answers and preserve short-buffer refusal. - [x] Complete the original strict debug/release component gates at this head. - [x] Link the matching [filesystem caller and interoperability controls](https://git.erikinkinen.fi/erix/lib-fs-crypto/pulls/8).
fix: Implement the complete CBC-CS3 ciphertext format
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 2s
CI / test (push) Successful in 37s
1b89fec4b7
Chain a zero-padded final plaintext fragment with the encrypted preceding block and reconstruct that block before decryption. Exchange the final two complete ciphertext blocks for aligned inputs, retaining ordinary CBC only for a single block and the separate CBC API. Independent fixed answers cover every byte length from sixteen through sixty-four in both directions; previous nonstandard ciphertext is not silently accepted.
erikinkinen added this to the Alpha 1 milestone 2026-11-13 03:45:10 +01:00
erikinkinen changed title from WIP: Correct CBC-CS3 ciphertext stealing to Correct CBC-CS3 ciphertext stealing 2026-11-13 03:51:24 +01:00
Author
Owner

The correction is ready for review. Independent ciphertext answers cover both directions, and the current head passes the original strict component gates in debug and optimized builds. Filesystem-image adoption and any migration of prototype ciphertext remain separate owner responsibilities.

The correction is ready for review. Independent ciphertext answers cover both directions, and the current head passes the original strict component gates in debug and optimized builds. Filesystem-image adoption and any migration of prototype ciphertext remain separate owner responsibilities.
erikinkinen changed target branch from feature/aes-field-transformations to feature/aes-key-erasure 2026-11-13 20:52:08 +01:00
erikinkinen manually merged commit b45cfde921 into feature/aes-key-erasure 2026-11-13 20:52:09 +01:00
Sign in to join this conversation.
No description provided.