Skip to content

v0.8.0: Redesigned elliptic curves interface and more

Compare
Choose a tag to compare
@survived survived released this 15 Sep 12:54
· 26 commits to master since this release

Release includes a large redesign of elliptic curve API, performance improvements, new crypto primitives, and bumped/removed outdated dependencies.

  • Elliptic curve API #119
    We significantly redesigned the interface and made it pleasant to use — check out the documentation! The core of our library is two structures: Point<E> and Scalar<E> that represent a point on curve, and a scalar mod group order respectively (E stands for choice of curve, e.g. Secp256k1). Using them is easy: they implement many traits like serialization and arithmetic operators, so you can add two points, multiply point at scalar, etc. It's easy to write algorithms generic over choice of curve.

    Example

    use curv::elliptic::curves::{Point, Scalar, Secp256k1};
    
    // Samples a random nonzero scalar (mod group order)
    let secret = Scalar::<Secp256k1>::random();
    // Multiplies generator at secret, retrieving a public point
    let public = Point::generator() * secret;
  • New crypto primitives
    We added LDEI proof (low degree exponent interpolation), and convenient Polynomial primitive. They are foundation of many MPC protocols.
  • Try and Increment when converting hash to scalar #128
    That improves performance and security of conversion

  • Made the commitments generic over the hash function #129
    Allows the user to choose their own hash function when using our hash and related commitments

  • KaTeX integration into documentation #131
    It's a must-have for purposes of the library. Now we can easily put a formula, and it will be properly rendered at docs.rs. E.g. check out Polynomial documentation. If you want to integrate KaTeX into your crate — take a look at rustdoc_katex_demo!

  • Updated/removed outdated dependencies

    • hmac: v0.7.1v0.11
    • digest: v0.8.1v0.9
    • sha2: v0.8.0v0.9
    • sha3: v0.8.2v0.9
    • Removed rust-crypto, ring-agorithms
  • ...and more! See CHANGELOG.md to find all the changes the library has got through.

Compatibility notes

Serialization format of points, scalars, bigints (and therefore of everything else in the library) has been changed, and it's not compatible with older curv.

Upgrading from older versions of curv

Upgrading proccess can be challenging as API has been significantly changed. Contact us if you have any questions/issues related to migration to the latest curv.