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

dsa: migrate to crypto-bigint #906

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

baloo
Copy link
Member

@baloo baloo commented Feb 16, 2025

This is a rebase of #784

There are two commits on top that I think should fix tests. There is a bit of cleanup to do still.

@baloo baloo marked this pull request as draft February 16, 2025 08:50
@baloo
Copy link
Member Author

baloo commented Feb 16, 2025

cc @aumetra

@aumetra
Copy link
Contributor

aumetra commented Feb 16, 2025

Apologies, I was a bit absent lately. I'll have a look when I get the time (which should be in like two hours at max)

@baloo
Copy link
Member Author

baloo commented Feb 16, 2025

No need to apologize! Please take care.
That was only to keep you updated on the progress and let you chime in as needed.

If there are specific things you wanted to be taken care of, please let me know I'd be happy to.

@baloo
Copy link
Member Author

baloo commented Feb 17, 2025

out of the last 3 tests that still fail:

  • sign_message: that one needs the vectors to be adjusted, we're switching the backend and by doing so the primes we get from the RNG are different because their generation is now different.
  • signer_verifier_signature: that one is a precision that needs to be adjusted.
  • verify_signature: I'm not quite sure yet.

Overall having to adjust precisions seems to be ... inefficent? error-prone? I guess there is a way better method for doing that. I need to have a look at RSA how they did it there.

@baloo baloo force-pushed the baloo/dsa/crypto-bigint branch from b8e5f35 to a5b6804 Compare February 18, 2025 05:56
@baloo baloo force-pushed the baloo/dsa/crypto-bigint branch from a5b6804 to fde178e Compare February 18, 2025 05:58
@aumetra
Copy link
Contributor

aumetra commented Feb 19, 2025

Overall having to adjust precisions seems to be ... inefficent? error-prone? I guess there is a way better method for doing that. I need to have a look at RSA how they did it there.

Seems like even rsa did the same thing. Just via the .widen method which is, I guess, a newer method that didn't exist when I started this PR a year ago

@aumetra
Copy link
Contributor

aumetra commented Feb 19, 2025

Scratch that, it existed, I just didn't see it at that time

@tarcieri
Copy link
Member

@baloo the precision aspect is definitely a bit tricky. num-bigint does it automatically, however this leads to variable-time operation depending on the value’s precision which is unsuitable for private key operations

@baloo
Copy link
Member Author

baloo commented Feb 19, 2025

Oh I understand why it's done! I'm just not sure I know what I'm doing [insert here the picture of a dog].

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.

3 participants