-
Notifications
You must be signed in to change notification settings - Fork 793
BIP-0062 Canonical Signatures #2500
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
Conversation
|
Looks reasonable to me. |
b90f5b6 to
414ac3f
Compare
9af0755 to
63fc2a8
Compare
goldibex
left a comment
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.
In general -- reading this PR makes me realize we need a way to test transitions across hardforks. It would be really nice to have a test that
- tries to submit a transaction with a non-FC-canonical but BIP-0062-canonical signature pre-fork and asserts failure
- joins HF20
- submits the transaction again and asserts success
| const authority_getter& get_owner, | ||
| const authority_getter& get_posting, | ||
| uint32_t max_recursion = STEEM_MAX_SIG_CHECK_DEPTH | ||
| uint32_t max_recursion/* = STEEM_MAX_SIG_CHECK_DEPTH*/, |
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.
Please just delete these defaults rather than comment them out
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 left the defaults there because there is some cleanup that needs occur post HF that will cleanup this interface and restore it to its pre hardfork state.
| for( size_t i = 0; i < 4; i++ ) | ||
| { | ||
| sig <<= 64; | ||
| sig += boost::endian::big_to_native( *( uint64_t* )( c.data + 33 + ( i * 8 ) ) ); |
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'm not convinced all this complexity is necessary. Since the numbers are both guaranteed to be big-endian and fixed-length, a simple memcmp should be all that's necessary to determine which is the larger number.
goldibex
left a comment
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.
See previous comments. memcmp or the equivalent c++ sugar is the easiest way to verify the supplied signature is smaller than N/2.
|
lgtm |
Closes #1944