Skip to content

Conversation

VolodymyrBg
Copy link

Fix array index calculation in three commitment functions that were causing
potential out-of-bounds access when storing the last element:

  • hash_salt_dg1_private_nullifier: correct index for private_nullifier
  • calculate_private_nullifier: correct index for sod_sig
  • hash_salt_country_signed_attr_dg1_e_content_private_nullifier: correct index for private_nullifier

The issue was that the index calculation was using the array size instead of
size - 1 for the last element position. This could lead to runtime errors
with certain input sizes.

Also fix typo in compute_merkle_root comment (removed duplicate "the").

@michaelelliot
Copy link
Contributor

@VolodymyrBg Can you please pull the latest changes into your branch? It should include the GitHub Actions CI workflow.

* ci: add GitHub Actions workflow

* ci: install bb 1.0.0-nightly.20250723
@VolodymyrBg VolodymyrBg force-pushed the fix/array-index-out-of-bounds-commitment-functions branch from ae46c15 to 2214f7a Compare August 26, 2025 04:54
@VolodymyrBg
Copy link
Author

@VolodymyrBg Can you please pull the latest changes into your branch? It should include the GitHub Actions CI workflow.

Done

@michaelelliot
Copy link
Contributor

@VolodymyrBg Looks like the tests failed on your branch.

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