This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move invent_firstbits() into sshrsag.c.
It's now a subroutine specific to RSA key generation, because the reworked PrimeCandidateSource system can handle the requirements of DSA generation automatically. The difference is that in DSA, one of the primes you generate is used as a factor in the generation of the other, so you can just pass q as a factor to pcs_require_residue_1, and it can get the range right by itself. But in RSA, neither prime is generated with the other one in mind; they're conceptually generated separately and independently, apart from that single joint restriction on their product. (I _could_ have added a feature to PrimeCandidateSource to specify a range for the prime more specifically than a few initial bits. But I didn't want to, because it would have been more complicated than doing it this way, and also slightly less good: if you invent one prime first and then constrain the range of the other one once you know the first, then you're not getting an even probability distribution of the possible _pairs_ of primes - you're privileging one over the other and skewing the distribution.)
- Loading branch information
Showing
3 changed files
with
115 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters