-
Notifications
You must be signed in to change notification settings - Fork 65
Classic Binary Extended GCD #854
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
Conversation
f4eb716
to
b5dd779
Compare
b5dd779
to
104a33a
Compare
@tarcieri this PR is ready for review. |
|
||
pub(crate) struct ExtendedUint<const LIMBS: usize, const EXTENSION_LIMBS: usize>( | ||
Uint<LIMBS>, | ||
Uint<EXTENSION_LIMBS>, | ||
); | ||
|
||
impl<const LIMBS: usize, const EXTRA: usize> ExtendedUint<LIMBS, EXTRA> { | ||
/// Construct an [ExtendedUint] from the product of a [Uint<LIMBS>] and an [Uint<EXTRA>]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this syntax will linkify the resulting rustdoc:
/// Construct an [ExtendedUint] from the product of a [Uint<LIMBS>] and an [Uint<EXTRA>]. | |
/// Construct an [`ExtendedUint`] from the product of a [`Uint<LIMBS>`] and an [`Uint<EXTRA>`]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: there seem to be several instances of this below, including ones I didn't catch before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to approve this PR but it would be good to get any of these which are visible in public rustdoc fixed up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this syntax will linkify the resulting rustdoc:
You're absolutely correct that it is good thing to add those...
... which I'll have to do that in the next PR, given that you already merged this one 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Also, on my end [Uint<LIMBS>]
links to Uint
and gets displayed as Uint
, while
[`Uint<LIMBS>`]
still links to Uint
but gets formatted as Uint<LIMBS>
.
So, the backticks just add the LIMBS
, but not the link.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, there is a difference in the formatting. Adding backticks also formats the word as code, instead of just text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
This PR introduces the binary extended GCD algorithm, and all the boiler plate code necessary to use the xgcd algorithm.
Supersedes #761.