Skip to content

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.

1 participant