-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix the first two test vectors of verify fail test #1591
Conversation
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.
Concept ACK, thanks @siv2r
Can confirm that the comments of vector 1 and 2 of "verify_fail_test_cases" are incorrect and that the suggested vector fixes this. Check existing and suggested vector 1 with this script:
def parse_hex(x):
return int.from_bytes(bytes.fromhex(x), byteorder="big")
wrong_s = parse_hex("68537CC5234E505BD14061F8DA9E90C220A181855FD8BDB7F127BB12403B4D3B")
assert((n - wrong_s) == parse_hex("97AC833ADCB1AFA42EBF9E0725616F3C9A0D5B614F6FE283CEAAA37A8FFAF406"))
corr_s = parse_hex("012ABBCB52B3016AC03AD82395A1A415C48B93DEF78718E62A7A90052FE224FB")
assert((n - corr_s) == parse_hex("FED54434AD4CFE953FC527DC6A5E5BE8F6234907B7C187559557CE87A0541C46"))
I doubt it's worth incrementing the patch version of the spec but it would be nice if we could somehow reflect this in the change log, for example by adding a line to the top like
* 1.0.0 (2024-05-11):
* Fix minor issue in two test vectors.
0c6aff6
to
921536b
Compare
I updated the change log as suggested. Also, the |
921536b
to
83f831b
Compare
Addressed the change log comments |
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.
utACK 83f831b -- mod the date change (Yeah, it's better to set it to the commit date, but two days more or less don't make that big of a difference in the end :D
It took me a while to understand what's going on, but it all makes sense now. Nice catch!
- first two vectors of verify_fail_test - first two vectors of verify_error_test
83f831b
to
508e3a6
Compare
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.
utACK 508e3a6
I think the purpose of the date is to make it easier for people to look up the changes in the commit history. However, the date is wrong now anyway because github UI does not show the correct date of the commit 🤷. |
Two vectors of the
sign_verify
test use different partial signatures even though their signer set, message, and nonces are the same. These are those two vectors:Vector 1 (in
valid_test_ cases
):Vector 2 (in
verify_fail_test_cases
):In Vector 2, if we change the
signer_index
to 0 (the correct index),partial_sig_verify
will still fail. Therefore, it has the incorrect partial signature. As a result, creating another vector by negating this paritalsig is also incorrect.This PR fixes Vector 2 and the one created by negating Vector 2’s partial signature.
cc @jonasnick @real-or-random