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.
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
Filippo version of Ed25519 #462
base: master
Are you sure you want to change the base?
Filippo version of Ed25519 #462
Changes from 4 commits
25448ab
6fe4f1e
da9fb34
451c68d
9cc00ea
28dd3b4
14e7da3
b41db2d
c1fe1cd
b0f9796
f746f8b
c7e292c
c7253db
211afe7
b9c3f4d
bb9eac2
0d1c3cd
bd72d1d
251bafc
0c93a23
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
requiring it to be a multiple of 8
where is this check being done ?If I understand correctly, lines 53-54 do not seem to guarantee a multiple of 8, counter example: 0
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.
If I am correct then zero would also be a valid output for what we are trying to do.
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.
@si-co do you agree ?
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.
This function seems to have different problems:
sha512
when only 32 bytes are needed;.digest[:32]
to initialize the scalar, but returnsdigest[32:]
, which is not the digest used to generate the key.IMHO the best way to implement this function would be to use
SetBytesWithClamping
withsha256
to hash thebuffer
, assuming that's what the function is trying to do. If @parinayc20 adds the appropriate documentation we can continue the discussion.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 seems this would produce an infinite loop with a maliciously crafted
data
input, as:SetBytes
returns an error ifb[:]
does not represent a valid point on the curveb[:]
is crafted by copying bytes fromdata
anddata
's length (or a constant,p.EmbedLen()
).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 assume there's an expectation here that we're just "unlucky", could you document that?
Also, should the
for
loop provide guarantees that we're going to eventually come out of this loop ? (e.g. throw some kind of error if we've looped over N times)