forked from dalek-cryptography/curve25519-dalek
-
Notifications
You must be signed in to change notification settings - Fork 2
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
patch 3.2.0 #4
Open
umadayal
wants to merge
11
commits into
v3.2.0
Choose a base branch
from
patch-curve25519-v3.2.0
base: v3.2.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
patch 3.2.0 #4
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a09fe3a
patch 3.2.0
umadayal 23387e9
removed curve25519 package
umadayal 4c74cd5
new rand core
umadayal ca2d0a4
changed sp1 version and included Vec
umadayal f913adf
fix errors
umadayal 4080ad7
fix error
umadayal 889f2af
removed ZERO and MINUS_ONE from field
umadayal 1bca654
one
umadayal 7cd307f
chore: bump sp1 version (#6)
yuwen01 00167cd
revert: "chore: bump sp1 version (#6)" (#7)
yuwen01 dd90b0d
chore: bump sp1 (#8)
yuwen01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -821,6 +821,16 @@ impl Scalar { | |
ret | ||
} | ||
|
||
/// Get the bits of the scalar, in little-endian order | ||
pub(crate) fn bits_le(&self) -> impl DoubleEndedIterator<Item = bool> + '_ { | ||
(0..256).map(move |i| { | ||
// As i runs from 0..256, the bottom 3 bits index the bit, while the upper bits index | ||
// the byte. Since self.bytes is little-endian at the byte level, this iterator is | ||
// little-endian on the bit level | ||
((self.bytes[i >> 3] >> (i & 7)) & 1u8) == 1 | ||
}) | ||
} | ||
|
||
Comment on lines
+824
to
+833
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where did this come from? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need it for let a_bits = a.bits_le().collect::<Vec>(); in vartime_double_base.rs (from 4.1.3 patch) |
||
/// Get the bits of the scalar. | ||
pub(crate) fn bits(&self) -> [i8; 256] { | ||
let mut bits = [0i8; 256]; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Where did this come from?
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.
It's from patch 4.1.3. We mostly just need ONE for the patch so I can delete ZERO and MINUS_ONE