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

Re-arrange functionality to make ECDSA and Schnorr equal-ish citizens #327

Merged
merged 12 commits into from
Nov 12, 2021

Commits on Nov 11, 2021

  1. Make key module private

    We re-export all structs residing in that module. There is no reason
    to expose the internal module structure of the library publicly.
    thomaseizinger committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    8e96aba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    52d0554 View commit details
    Browse the repository at this point in the history
  3. Prefer use super::* import over manually picking items

    Tests are usually placed next to the code they are testing. As such,
    importing `super::*` is a good starting point.
    thomaseizinger committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    49c7e21 View commit details
    Browse the repository at this point in the history
  4. Move Signature and SerializedSignature to new ecdsa module

    With the introduction of Schnorr signatures, exporting a `Signature`
    type without any further qualification is ambiguous. To minimize the
    ambiguity, the `ecdsa` module is public which should encourage users
    to refer to its types as `ecdsa::Signature` and `ecdsa::SerializedSignature`.
    
    To reduce ambiguity in the APIs on `Secp256k1`, we deprecate several
    fucntions and introduce new variants that explicitly mention the use of
    the ECDSA signature algorithm.
    
    Due to the move of `Signature` and `SerializedSignature` to a new module,
    this patch is a breaking change. The impact is minimal though and fixing the
    compile errors encourages a qualified naming of the type.
    thomaseizinger committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    c47ead9 View commit details
    Browse the repository at this point in the history
  5. Move KeyPair to key module

    The `KeyPair` type is semantically unrelated to the schnorr signature
    algorithm.
    thomaseizinger committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    2e0e731 View commit details
    Browse the repository at this point in the history
  6. Rename schnorr::PublicKey to schnorr::XOnlyPublicKey

    The public key is unrelated to the signature algorithm. It will
    be moved out of the module in another commit. For ease of review,
    the renamed is kept separate.
    thomaseizinger committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    87d936a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d4fb819 View commit details
    Browse the repository at this point in the history
  8. Rename schnorrsig module to schnorr

    Schnorr is commenly known as a signature algorithm, we don't need
    to restate that in the name of the module.
    thomaseizinger committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    760559c View commit details
    Browse the repository at this point in the history
  9. Rename schnorr functions on Secp256k1 to match naming of ecdsa

    The naming scheme we employ is `{sign,verify, ...}_{ecdsa,schnorr}`.
    thomaseizinger committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    e0c3bb2 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ce44277 View commit details
    Browse the repository at this point in the history
  11. Move helper function below usage

    This is not C89. We can declare the more important things first.
    thomaseizinger committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    c5c9551 View commit details
    Browse the repository at this point in the history
  12. Fix typo in docs

    thomaseizinger committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    d244b4d View commit details
    Browse the repository at this point in the history