-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Implement signature verification #232
Conversation
hi @DavidBuchanan314 @snarfed could you pls help me with fixing 2 tests? we should deny non-low-S signature somehow |
Your |
This is where I implement low-s signing in picopds, but I didn't do verification yet https://github.com/DavidBuchanan314/picopds/blob/main/signing.py Your logic would be similar, but rather than correcting the value of s, you'd raise an exception. |
Also, for the record, I'm not 100% sure I got the check correct... it might be off-by-one, and I haven't written/found test cases to test the boundary cases. Like, I'm 99% sure, but I wouldn't give it that last 1% until it's been tested fully. |
@DavidBuchanan314 thank you! Now it passes tests. Could you pls explain where you get values of curve order? Upd. understood. This this was helpful: https://stackoverflow.com/a/70811080/8032027 |
Great question, you can find P-256 given in NIST SP 800-186 https://csrc.nist.gov/pubs/sp/800/186/final https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-186.pdf section 3.2.1.3. SEC 2 specifies both P-256 and K-256 (aka secp256r1, secp256k1) https://www.secg.org/sec2-v2.pdf |
2 tests are failing for now:
