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

Expose residue params and modulus in DynResidue #197

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

fjarri
Copy link
Contributor

@fjarri fjarri commented Mar 15, 2023

The functionality I would like to have:

  • extract DynResidueParams from a DynResidue object (to be able to, given one residue, initialize another one with the same params);
  • extract the modulus from DynResidueParams (to be able to implement some modulus-depending algorithms, e.g. square root)

Edit: I decided to wait on exposing the Montgomery form for now; I will just retrieve before serializing. Exposing it exposes the specific representation used by the residue, and the API needs some thought, e.g. whether we do a range check when assembling a DynResidue from the pre-calculated Montgomery form and params.

Changes:

  • Added DynResidueParams::modulus()
  • Added DynResidue::params()

@fjarri fjarri requested a review from tarcieri March 21, 2023 18:55
@tarcieri tarcieri merged commit 095640d into RustCrypto:master Mar 24, 2023
@fjarri fjarri deleted the expose-modulus branch March 27, 2023 21:36
@tarcieri tarcieri mentioned this pull request Apr 26, 2023
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