FEATURE/Add: add TRAX-L-17 tweakable block cipher - #508
Open
peacker wants to merge 1 commit into
Open
Conversation
Implements TRAX-L-17 (256-bit block, 256-bit key, 128-bit tweak, 17 steps), Aumasson/Beierle et al.'s Alzette-based tweakable block cipher from [BBBGPUV2020]_. Fixes two round-function bugs present in an earlier in-progress draft: the ELL diffusion function used a rotation instead of a true zero-filling left shift for the "v << 16" term, and the post-ELL word shuffle used the wrong permutation of the four branches. Both are corrected to match the designers' reference C code (traxl17_genkeys_ref / traxl17_enc_ref, Appendix D.2 of [BBBGPUV2020]_, also published at https://sparkle-lwc.github.io/trax), and validated bit-for-bit against an independent Python transcription of that reference code since no independently-published numeric test vectors for TRAX-L-17 exist.
|
peacker
marked this pull request as ready for review
August 24, 2026 11:25
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.



Summary
TraxBlockCipher(claasp/ciphers/block_ciphers/trax_block_cipher.py), TRAX-L-17 — Beierle, Biryukov, Cardoso dos Santos et al.'s tweakable ARX block cipher from the same paper/family as Alzette and CRAX.traxl17_enc_ref, Appendix D.2 of the eprint):ELL(x) = ROT(x ^ (x << 16), 16)—x << 16is a plain left shift, not a rotation.(x3, x2, x0, x1), not a simple cyclic rotation (the reference C's sequential, not simultaneous, assignments produce a different permutation than a naive reading suggests).Note on test vectors
No officially-published third-party KAT exists for TRAX-L-17 (only source code, no separate KAT appendix/third-party port like CRAX has). Validated against an independent line-by-line Python transcription of the designers' reference C implementation — flagged explicitly as self-derived (not third-party-published) in the class docstring and test file, with the source URL, so a reviewer can re-verify independently.
Test plan
sage -t claasp/ciphers/block_ciphers/trax_block_cipher.py— 10 doctests, all passedpytest -v tests/unit/ciphers/block_ciphers/trax_block_cipher_test.py— 4 passed