-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Endian related failure #442
Comments
Are you testing with a recent version of libsecp256k1 on the big endian system? That reported DER signature is a high-s one, which we stopped producing over 2 years ago. |
Completely up to date.
…On Thu, Feb 16, 2017, 7:25 PM Pieter Wuille ***@***.***> wrote:
Are you testing with a recent version of libsecp256k1 on the big endian
system? That reported DER signature is a high-s one, which we stopped
producing over 2 years ago.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#442 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGL5OJR6Gb6cPsOl4NYq0vzSTfFYOtjcks5rdRMOgaJpZM4MD0nF>
.
|
Looking into this, but it'll be hard to reproduce without access to a big-endian machine (especially one with a c++11 compiler...). A quick note: the "signature mismatch" is completely expected, as you're printing out the internal data of the secp256k1_signature type for this the header states |
FWIW, our internal tests and benchmarks all work on a BE host, but I don't currently have one with a C++11 compiler. |
I ran on big-endian MIPS and got this output:
Notably lacking the DER failure. The signature error is different and expected according to @sipa. |
Perhaps I will just be stating the obvious, but the given test appears to be completely spurious. For the first part (test_sign) EC_SIGNATURE purports to be the expected raw contents of the signature, but that is an opaque format (secp256k1_ecdsa_signature) as pointed out by others, and in practice varies according to endianness (and 32/64-bit). The second part (test_serialize_der) of the test independently serializes EC_SIGNATURE (note: not the actual generated signature) to a DER signature, but this test makes the same invalid assumption about the opaque format and cannot portably produce the expected DER result. |
Closing as "not a bug". Users of the library should never be inspecting or operating on opaque data structures. |
Running the following on little endian systems results in success, on big endian systems failure. Code provided below, along with platform output: test.cpp.txt
Little endian output:
Big endian output:
The text was updated successfully, but these errors were encountered: