-
Notifications
You must be signed in to change notification settings - Fork 138
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
[crypto] Fast & Loose Key validation in FastNFT #21
Comments
This issue on ed25519 suggests that this is a doc bug, and no further validity check is needed: This is also further evidenced by the docs on curve25519-dalek doc, that suggest that all edwards points are valid by construction: |
@huitseeker also says: |
We are also dependent on On small subgroup components: |
Due to verify batch we have to be consistent here (there are 2 reasons for that, but it's too complex to explain here - i.e., if we're not careful and use randomized batch sig verification inside contracts, then one could even break determinism - and result to liveness issues). The zebra lib specifically designed their protocol to support that, and Diem's implementation was stricter than zebra (based on our EdDSA security paper). This will be part of the generic crypto agility effort (all of the algorithms will need a key validation mechanism to be on the safe side). |
The single error case of this
TryFrom
is just an invalid length error. There is a host of other problems completely ignored by the current implementation:The above takes exactly none of that into account. Further, several of those checks will not be performed by
check_internal
'sdalek::PublicKey::from_bytes
(and the library has a nice warning to mention some of that).I admit it's probably a completely orthogonal point to this PR, and worth tackling in a different issue (probably extracted from this comment), but I'd appreciate a spectacular comment on
PublicKeyBytes
making this clear. Here is an example of my personal minimum bar for the word "spectacular".Originally posted by @huitseeker in MystenLabs/sui#94 (comment)
The text was updated successfully, but these errors were encountered: