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

Redo the arithmetic interface for curv #121

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Redo the arithmetic interface for curv #121

wants to merge 4 commits into from

Conversation

elichai
Copy link
Contributor

@elichai elichai commented Jul 19, 2021

This gives a unified trait for our BigInt backend in a way that allows us to abstract over the backend.

This problems with using features:

  1. Any library using curv had to either use the default gmp backend or explictly replace it with num-bigint, or add their own features that change the features in our library.
  2. If any other library in the dependency tree enabled a different backend it would fail compiling.

The combination of these meant that in practice it was hard to actually allow the end user(binaries) to choose their desired backend.

Furthermore, this change will allow users to implement the BigInt trait to their own backends, and allows us to add more backends more easily.

I'm still debating myself if it's better to use a trait or a wrapper like struct BigInt<B: BigIntBackend>(B) that will use the trait to provide method and trait implementations.

I also replaced https://crates.io/crates/rust-gmp-kzen with https://crates.io/crates/rug which is a nice wrapper around libgmp and is actively maintained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant