This repository was archived by the owner on Sep 8, 2025. It is now read-only.
Create public key validation function#88
Merged
pipermerriam merged 2 commits intomasterfrom Sep 6, 2017
unknown repository
Merged
Create public key validation function#88pipermerriam merged 2 commits intomasterfrom unknown repository
pipermerriam merged 2 commits intomasterfrom
unknown repository
Conversation
pipermerriam
reviewed
Sep 5, 2017
evm/utils/secp256k1.py
Outdated
| left = big_endian_to_int(public_key[0:32]) | ||
| right = big_endian_to_int(public_key[32:64]) | ||
| return left, right | ||
| if validate_raw_public_key(public_key): |
Member
There was a problem hiding this comment.
This should not be nested in an if statement. Instead it should just be called at the beginning of the function. Same with the other applications of this validator.
pipermerriam
reviewed
Sep 5, 2017
evm/validation.py
Outdated
|
|
||
|
|
||
| def validate_raw_public_key(value): | ||
| if len(value) != 64 or validate_is_bytes(value): |
Member
There was a problem hiding this comment.
Can you remove the validate_is_bytes call from this statement and place it on it's own line above this line.
Author
|
@pipermerriam Committed the requested changes. |
pacrob
added a commit
to pacrob/py-evm
that referenced
this pull request
Dec 18, 2023
* remove testall because it doesnt work
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What was wrong?
The same code for validating public keys was used in two different places.
How was it fixed?
That code was extracted into a new function in evm.validation.validate_raw_public_key
Cute Animal Picture