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

Add TryFrom<[u8; 32]> implementations for Scalar and EdwardsPoint #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Jul 9, 2021

  1. Unify use of core::fmt module

    Instead of importing `Debug` directly and fully-qualifying fmt via
    `::core::fmt` in other places, we bring the whole `core::fmt` module
    into scope and refer to `Formatter` and `Result` as `fmt::Formatter`
    and `fmt::Result`.
    thomaseizinger committed Jul 9, 2021
    Configuration menu
    Copy the full SHA
    97b44b6 View commit details
    Browse the repository at this point in the history
  2. Add TryFrom<[u8; 32]> implementations for Scalar and EdwardsPoint

    Although not strictly required by trait-bounds, we introduce a
    dedicated error type in case the conversion fails. If the `std`
    feature is enabled, this error type implements `std::error::Error`.
    
    Having a dedicated error type improves ergonomics a lot as many
    uses of `TryFrom` imply `TryFrom::Error: std::error::Error`.
    
    We don't alter the original APIs of `Scalar` and `EdwardsPoint` to
    maintain backwards compatible.
    thomaseizinger committed Jul 9, 2021
    Configuration menu
    Copy the full SHA
    46bdbc9 View commit details
    Browse the repository at this point in the history