Skip to content

Conversation

@cedwies
Copy link
Collaborator

@cedwies cedwies commented Dec 18, 2025

Centralizes salt root access behind the HAL abstraction, enabling full test isolation without C memory dependencies.

TestingHal initializes with a default salt root to preserve existing test behavior without manual setup in each test.

The 2 rust_salt_hash_data tests keep using mock_memory() + C-backed salt root because the extern "C" shim internally constructs BitBox02Hal—these tests verify the FFI path works.

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@cedwies cedwies requested a review from benma December 18, 2025 09:36
@cedwies cedwies changed the title Move salt_root functions to HAL HAL: refactor salt_root functions Dec 18, 2025
@benma
Copy link
Collaborator

benma commented Dec 18, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Collaborator

@benma benma left a comment

Choose a reason for hiding this comment

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

utACK, nice! (Left a small comment, please take a look at that before merging).

lock();

let mut hal = TestingHal::new();
let _ = hal.memory.reset_hww();
Copy link
Collaborator

@benma benma Dec 18, 2025

Choose a reason for hiding this comment

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

Why is this call needed?

If needed, prefer reset_hww().unwrap() instead of ignoring the output.

edit: tested, tests also pass without this line. TestingHal::new() inits the fields to the same values after all.

@cedwies cedwies force-pushed the cedwies/salt-root branch 3 times, most recently from 8b8e98b to aa315e3 Compare December 18, 2025 14:06
Centralizes salt root access behind the HAL abstraction,
enabling full test isolation without C memory dependencies.

TestingHal initializes with a default salt root to preserve
existing test behavior without manual setup in each test.

The 2 rust_salt_hash_data tests keep using mock_memory() +
C-backed salt root because the extern "C" shim internally
constructs BitBox02Hal—these tests verify the FFI path works.
@cedwies cedwies merged commit 05bc165 into BitBoxSwiss:master Dec 18, 2025
66 of 72 checks passed
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