Skip to content
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

Remove derives for ffi wrapped types #515

Closed

Commits on Nov 16, 2022

  1. Remove derives for ffi wrapped types

    Currently we are deriving various traits that call down to the traits
    implemented in secp265k1-sys that in turn call down to implementations
    on the inner byte array. Since we cannot guarantee the inner byte arrays
    in secp256k1-sys this results in trait implementations that may not be
    stable across versions of the library.
    
    For `XOnlyPublicKey`, `KeyPair`, and `ecdsa::Signature` manually
    implement `PartialEq`, `Eq`, `PartialOrd`, `Ord`, and `Hash` by first
    converting the type into a form that is guaranteed to be stable across
    library versions e.g., by serializing it to a known format.
    tcharding committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    86608c2 View commit details
    Browse the repository at this point in the history
  2. Implement fast unstable comparisons

    We recently improved the comparison implementations to be stable across
    library versions by first serializing the data types before comparing
    them instead of just comparing the inner bytes. This had the downside
    that the comparisons are now slower.
    
    Add public methods `cmp_fast_unstable` and `eq_fast_unstable` to each
    of the types that wraps an FFI type.
    tcharding committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    94f715e View commit details
    Browse the repository at this point in the history