Skip to content

Conversation

@pdroalves
Copy link
Contributor

closes: please link all relevant issues

PR content/description

Check-list:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Relevant issues are marked as resolved/closed, related issues are linked in the description
  • Check for breaking changes (including serialization changes) and add them to commit message following the conventional commit specification


// Modulus switch
int size = num_glwes * compression_params.glwe_dimension *
auto size = num_glwes * compression_params.glwe_dimension *
Copy link
Member

Choose a reason for hiding this comment

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

uint32_t seems to be fine to capture the result of that mul, otherwise we might need to cast one element to uint64_t

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks ok indeed, the first prod will always remain small and total_lwe_bodies_count would have to be insanely big to make int insufficient for this 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

int is not terrible. We still can fit a lot of LWEs in there before overflowing. However, we don't usually use that type in the rest of the library and doubling the space for size would not be bad.

Copy link
Member

Choose a reason for hiding this comment

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

yup i am a bit paranoid with the int too, prefer the uint32_t at least.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes let's go for uint32_t instead of int or auto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants