-
Notifications
You must be signed in to change notification settings - Fork 255
Fix to_bytes() for ProjectivePoint::identity()
#443
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
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #443 +/- ##
==========================================
+ Coverage 64.45% 64.51% +0.05%
==========================================
Files 28 28
Lines 3584 3590 +6
==========================================
+ Hits 2310 2316 +6
Misses 1274 1274 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This is an unfortunate mismatch between the
Technically this is an invalid SEC1 encoding, but there's nothing else that can be done with a fixed-sized |
We could change the interface to return an |
|
Really it's an eccentricity of the SEC1 encoding, and I doubt they would want to make the API fallible just to support that. |
Ah, I wasn't aware this isn't owned by RustCrypto. |
|
It'd also be good to make sure that |
|
This is fine as a start. I'll take care of the other comments I raised. |
`GroupEncoding` uses a fixed-width `Repr` whereas SEC1 is variable-width with respect to compressed points versus the identity. This change allows 33-bytes of zeroes to be used as the identity. Technically that's not a valid SEC1 encoding: the SEC1 encoding for the identity is 1-byte: 0x00. However, this is the best we can do with a fixed-width encoding. See also: #443 and #444
`GroupEncoding` uses a fixed-width `Repr` whereas SEC1 is variable-width with respect to compressed points versus the identity. This change allows 33-bytes of zeroes to be used as the identity. Technically that's not a valid SEC1 encoding: the SEC1 encoding for the identity is 1-byte: 0x00. However, this is the best we can do with a fixed-width encoding. See also: #443 and #444
This could maybe alternatively be fixed "upstream" in
EncodedPoint::len()?Fixes #442.