-
Notifications
You must be signed in to change notification settings - Fork 2
CSIDH #1
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
Open
AndHell
wants to merge
20
commits into
GiacomoPope:main
Choose a base branch
from
AndHell:csidh
base: main
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
CSIDH #1
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d53031c
add csidh field
AndHell b97a802
[WIP] first (still buggy) basic csidh
AndHell 28fe7c9
Merge branch 'GiacomoPope:main' into csidh
AndHell fa05bd2
Merge branch 'GiacomoPope:main' into csidh
AndHell e29fe00
Merge branch 'GiacomoPope:main' into csidh
AndHell 2a82e65
[csidh] use const generic for array lenght
AndHell 05eed1f
working csidh 512
AndHell c8548a7
[csidh] expand key range to [-B..B] and add some comments
AndHell 3e5ab17
[csidh] move rand_pointx to csidh instead of curve
AndHell 0976758
Merge branch 'GiacomoPope:main' into csidh
AndHell c7abbc4
[csidh] add a simple benchmark
AndHell b67a7e6
Merge branch 'GiacomoPope:main' into csidh
AndHell 7bdf7ca
Merge branch 'GiacomoPope:main' into csidh
AndHell 7cadbb0
[csidh] use velu sqrt
AndHell 6a9d901
[WIP] csidh verify
AndHell ef1a717
csidh verify
AndHell f90629c
cleanup and faster point sampling
AndHell 7318773
[csidh] add struct Bn for constants
AndHell 2a633fc
struct Bn from macro
AndHell 4b3e848
[wip] use BnTrait in velu
AndHell 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 hidden or 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 hidden or 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 hidden or 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
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.
Cant we have this value as a
Fp
and then avoid the need for, 5
? Similar to how we have constants in the sidh implThere 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.
Yeah, this part is quite ugly.
The issue is that we need 4sqrt(p) as a bigint (bn), not as a Fp, in the verification, to check against the order of the random point.
The cleanest way would probably be to have a struct for bn.
I'll try to come up with something.
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.
We do we need it to be a big number? For scalar multiplication? One option would be to use a Fp element and then encode this to bytes for scalar multiplication? Another, yes, would be to make a BN type
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.
We only use this constant to check if the order of a point is > 4sqrt(p).
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.
Oh I see, this is alg 2 of (https://eprint.iacr.org/2022/880.pdf)...
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.
I think the "best" method at the moment is have$4 \sqrt{p}$ as a
Fp
type in the structure and then in verify we can do something likewhere
&self.four_sqrt_p.encode()
will have type&[u8]
andbytes_to_bn_vartime
can convert from base 2^8 to base 2^64?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.
I ended up adding a small Bn struct as a wrapper.
Let me know what you think about this approach.
If you think it's suitable I can also extend the struct.