Preventing Asset Base from being the identity point on the Pallas curve#71
Merged
vivek-arte merged 18 commits intozsa1from Jun 21, 2023
Merged
Preventing Asset Base from being the identity point on the Pallas curve#71vivek-arte merged 18 commits intozsa1from
vivek-arte merged 18 commits intozsa1from
Conversation
PR Summary
|
a715196 to
271b2bf
Compare
…nt asset base cannot be signed
6ccf5ff to
112aa1f
Compare
PaulLaux
reviewed
Jun 20, 2023
src/issuance.rs
Outdated
|
|
||
| fn generate_identity_point_asset_base() -> AssetBase { | ||
| let identity_point = | ||
| (pallas::Point::generator() * -pallas::Scalar::one()) + pallas::Point::generator(); |
Collaborator
There was a problem hiding this comment.
What is the source of this expression?
Collaborator
There was a problem hiding this comment.
Avoid pallas:: by importing the concrete expressions.
Author
There was a problem hiding this comment.
The expression is from pasta-curves-0.5.1/src/pallas.rs, line 95 (GitHub permalink here).
I used generator() to get a point on the curve instead of using the hard-coded r value over there, as any point on the should generate the identity this way.
Author
There was a problem hiding this comment.
imported pallas::Point and pallas::Scalar
PaulLaux
reviewed
Jun 20, 2023
PaulLaux
approved these changes
Jun 20, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As in the title, this is done in two portions:
AssetBase::derive(), which panics if the output is going to be the identity point. This panic will occur with negligible probability due to the properties of the hash.verify_supply()function now returns an error if the Asset Base of the notes involved is the identity point.