poanetwork / vdf

An implementation of Verifiable Delay Functions in Rust
Apache License 2.0
169 stars 53 forks source link

Pluggable bignum backends #7

Open DemiMarie opened 5 years ago

DemiMarie commented 5 years ago

Currently, the vdf crate is hard-coded to use GMP as its bignum library. There are many reasons one might want to use an alternative:

Licensing
GMP is LGPL3+/GPL2+, which is often undesirable.
Hardware acceleration
GMP is the fastest software bignum library extant, but it is still far slower than purpose-built accelerator hardware. A pluggable backend could enable such hardware to be used.
Portability
GMP is written in C and assembler, and uses autotools to build. This is especially annoying on Windows.
DemiMarie commented 5 years ago

I think I will use OpenSSL for this.

c0gent commented 5 years ago

Using a non-GPL library is definitely important. Have you looked at https://crates.io/crates/ramp?

I'm not sure that I'd spend a lot of time on a pluggable backend at this point unless it's really easy but that's your call.