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

[rlwe]: added .N() and .LogN() to rlwe.Element #451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pro7ech
Copy link
Contributor

@Pro7ech Pro7ech commented Apr 14, 2024

This PR adds the methods .N() and .LogN to the rlwe.Element.

This is a quality of life change that has two purposes:

  • Enables the user to get an easy access to the value of ring degree or its base 2 logarithm directly from rlwe.Ciphertext or rlwe.Plaintexts. It is possible to already get these values by for example calling bits.Len64(uint64(len(ct.Value[0].Coeffs[0]) - 1)), however only experienced users will know that this is possible.
  • Additionally, this improves code readability by replacing code such as bits.Len64(uint64(len(ct.Value[0].Coeffs[0]) - 1)) by ct.LogN().

Such information is for example needed when dealing with multiple parameter sets of different ring degree to be able to properly process an input ciphertext.

@qantik
Copy link
Contributor

qantik commented Apr 28, 2024

Hi, can you give some context to this PR?

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.

None yet

2 participants