Skip to content

Conversation

@reneme
Copy link
Collaborator

@reneme reneme commented Sep 13, 2025

This applies the consteval constructor idiom we talked about before to the Keccak_Permutation class. As a result, it is not possible to instantiate the Keccak-p at runtime anymore, but all configurations have to be statically declared and simply copied at runtime.

At this point, I'm not sure that this is really worth it (due to the fairly verbose and duplicated declarations in the Keccak-based algorithm implementations). With the basic refactoring and the integration of the Ascon-based algorithms now merged, I'd suggest to come back to this in isolation. Hence the "draft" status.

@reneme reneme self-assigned this Sep 13, 2025
@reneme reneme force-pushed the refactor/static_keccak_p branch from f773df8 to b841632 Compare September 13, 2025 15:25
@reneme reneme mentioned this pull request Sep 13, 2025
@reneme
Copy link
Collaborator Author

reneme commented Sep 13, 2025

Apparently clang had a oopsie on macos-13 building the amalgamation. This seems to be caused by the changes in this PR, given that the base PR (#5101) seems to pass this just fine. 😨

  clang: error: unable to execute command: Segmentation fault: 11
  clang: error: clang frontend command failed due to signal (use -v to see invocation)
  Apple clang version 15.0.0 (clang-1500.1.0.2.5)
  Target: x86_64-apple-darwin22.6.0
  Thread model: posix
  InstalledDir: /Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  clang: note: diagnostic msg: 
  ********************
  
  PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
  Preprocessed source(s) and associated run script(s) are located at:
  clang: note: diagnostic msg: /var/folders/vk/nx37ffx50hv5djclhltc26vw0000gn/T/botan_all-1371a4.cpp
  clang: note: diagnostic msg: /var/folders/vk/nx37ffx50hv5djclhltc26vw0000gn/T/botan_all-1371a4.sh
  clang: note: diagnostic msg: Crash backtrace is located in
  clang: note: diagnostic msg: /Users/runner/Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
  clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
  clang: note: diagnostic msg: 
  
  ********************

@coveralls
Copy link

coveralls commented Sep 13, 2025

Coverage Status

coverage: 92.016% (+1.3%) from 90.686%
when pulling 8f49980 on reneme:refactor/static_keccak_p
into f8ef97b on randombit:master.

This enforces that the instantiating constructor of Keccak_Permutation
is called at compile-time only. At runtime, only the copy constructor or
copy assignment is allowed.
@reneme reneme force-pushed the refactor/static_keccak_p branch from b841632 to 8f49980 Compare November 4, 2025 13:24
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.

2 participants