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

Investigate potential off by one issue in pack_bit_vector_into_field_element_vector #107

Open
ValarDragon opened this issue Oct 5, 2021 · 1 comment

Comments

@ValarDragon
Copy link
Member

pack_bit_vector_into_field_element_vector everywhere uses fieldT::floor_size_in_bits(), but it seems like it should be using capacity/ceil_size_in_bits().

(This got changed from capacity in #103, however that was a non-breaking change, and actually just reflected what the old field API did)

@zk-Lee
Copy link

zk-Lee commented Dec 9, 2022

@ValarDragon,
I also thought this was an error and checked it.
However, div_ceil is called inside the function.
Therefore, The repacked_size seems to be calculated safely.

When "vector bit size" and "field bit size" are the same, and the "vector value" is greater than the "field size", I think ceil_size_in_bits() is not sufficient.

Am I misunderstanding?

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

No branches or pull requests

2 participants