Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Origin Tags part 3 (Memory) #9758

Merged
merged 11 commits into from
Nov 7, 2024
Merged

feat: Origin Tags part 3 (Memory) #9758

merged 11 commits into from
Nov 7, 2024

Conversation

Rumata888
Copy link
Contributor

@Rumata888 Rumata888 commented Nov 5, 2024

This PR:

  1. Adds Origin Tags for tracking dangerous interactions to all stdlib memory primitives
  2. Expands the tests from TwinRomTable
  3. Fixes a bug with the use of nonnormalized value.

@Rumata888 Rumata888 force-pushed the is/origin_tag_part_3 branch 2 times, most recently from dfa79be to ccc27ff Compare November 6, 2024 17:03
@Rumata888 Rumata888 self-assigned this Nov 7, 2024
@Rumata888 Rumata888 force-pushed the is/origin_tag_part_3 branch from 44d3d72 to 85eec78 Compare November 7, 2024 11:39
@Rumata888 Rumata888 changed the title wip: Origin Tags part 3 (Memory) feat: Origin Tags part 3 (Memory) Nov 7, 2024
@@ -247,7 +273,13 @@ template <typename Builder> void ram_table<Builder>::write(const field_pt& index

_index_initialized[cast_index] = true;
} else {
_context->write_RAM_array(_ram_id, index_wire.normalize().get_witness_index(), value_wire.get_witness_index());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here's the bug

@Rumata888 Rumata888 added the product-security PRs extending our security mechanisms label Nov 7, 2024
@Rumata888 Rumata888 requested a review from Sarkoxed November 7, 2024 12:38
@@ -49,13 +52,19 @@ template <typename Builder> void rom_table<Builder>::initialize_table() const
context->set_ROM_element(rom_id, i, entries[i].get_witness_index());
}

// Preserve tags to restore them in the future lookups
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you forgot to initialize the tags inside the rom_table constructor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a vector, so it is default-initialized

Copy link
Contributor

@Sarkoxed Sarkoxed left a comment

Choose a reason for hiding this comment

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

LGTM

@Rumata888 Rumata888 merged commit d77e473 into master Nov 7, 2024
46 of 47 checks passed
@Rumata888 Rumata888 deleted the is/origin_tag_part_3 branch November 7, 2024 17:01
ludamad pushed a commit that referenced this pull request Nov 11, 2024
This PR:
1. Adds Origin Tags for tracking dangerous interactions to all stdlib
memory primitives
2. Expands  the tests from TwinRomTable
3. Fixes a bug with the use of nonnormalized value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product-security PRs extending our security mechanisms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants