-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d19ecd
commit 2c86134
Showing
1 changed file
with
14 additions
and
2 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
2c86134
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.
Hi,
Just noticed that you were considering rejecting signatures with S>=l in your implementation.
Thinking about releasing the next version of libsodium with the check as well. We know of at least one valid use case, and I can't think of any downsides of being less liberal.
Are you still considering this?
2c86134
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.
@jedisct1 I'm not sure what's the best way to proceed.
API wise I see three possible approaches:
VerifyStrict
verification functionIsStandard
/IsCanonical
helper functionI'm not a fan of variant 2. I prefer variant 3 if few Ed25519 implementations include the checks to avoid incompatiblities and variant 1 if we get broad agreement between implementers on which checks to perform.
I'm also not sure which properties to validate.
S < l
isn't the only way a signature can be non standard:S < l
Security issues: Malleable
Verification cost: Cheap. Just an inequality.
R.y >= P
whereP
is the order of the fieldSecurity issues: Malleable, but only if adding P doesn't overflow into the next bit. For Ed25519 this only affects 19 points, so without a malicious signer this doesn't happen. Malicious signers can already produce varying signatures by choosing a different nonce.
Verification cost: Cheap. Just an inequality, and we need the same code for
S < l
, so the complexity is low a s well.R
not on the curve but on the twistSecurity issues: none
Verification cost: Cheap. Check the curve equation which costs a handful of field multiplications.
Low order
R
Security issues: Signer doesn't commit to a message. See It's possible to forge messages that crypto_sign_open verifies if the public key is zero. jedisct1/libsodium#112 for a discussion.
Verification cost: cheap (compare against a blacklist (a dozen or so entries), or multiply with 8 and check against even fewer values.
R
not in the subgroup generated by the base pointB
Security issues: none
Verification cost: A naive implementation would be expensive. It's probably possible to merge it with the scalar multiplication, but that adds complexity and might not work at all with batch verification.
Verifiying 0-3 is cheap. 4 is expensive and has no security impact. So verifying 0-3 sounds like a decent plan.
(It's possible that properties where I didn't think of a security impact actually do have one.)