Skip to content

Conversation

Parrot7483
Copy link
Collaborator

@Parrot7483 Parrot7483 commented Sep 18, 2025

This PR adds full type checking for the SHA3 portable version for #395

Extract using hax.py extract --portable, prove using hax.py prove.

Besides prove code the following things where changed:

  • reorder functions in libcrux-sha3/src/generic_keccak/xof.rs
  • The absorb_full function in libcrux-sha3/src/generic_keccak/xof.rs previously did not always consume the internal buffer when it was full. This state could only be reached by misusing the API. The only bug I found.
  • split up the rho and pi function for verification purpose

This version contains a few things I would consider "hacks"

  • The extraction for the squeeze does not work. We add the expected F* code using hax_lib::fstar::replace
  • impl From<u32> for Algorithm does not work because of the panic.
  • In libcrux-sha3/src/generic_keccak/xof.rs the #[hax_lib::fstar::options("...")] has no effect. I use an hax_lib::fstar::before instead

@Parrot7483 Parrot7483 force-pushed the Parrot7483/sha3-type-check branch from 8f7a614 to 223bcaf Compare September 18, 2025 11:07
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a good idea to switch back to a theta_rho function (how it was before lax check), splitting it up the same way.

@Parrot7483 Parrot7483 marked this pull request as ready for review September 18, 2025 11:50
@Parrot7483 Parrot7483 requested review from a team as code owners September 18, 2025 11:50
}

#[cfg(hax)]
pub(crate) fn keccak_xof_state_inv<
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PARALLEL_LANES is not needed here anymore

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.

1 participant