ZenGo-X / curv

Rust language general purpose elliptic curve cryptography.
MIT License
264 stars 111 forks source link

Require Point/Scalar to be Send+Sync #170

Closed survived closed 1 year ago

survived commented 1 year ago

Currently, points and scalars are not usable in generic code with thread safety requirements as Point<E> is not necessarily Send+Sync. This PR updates generic bounds of Curve, ECPoint, Scalar and requires them always to be Send+Sync.

Waiting feedback from @RustMania on whether is addresses the problem

RustMania commented 1 year ago

Sadly, the master , regardless of the change , has problems with dependencies. In attempt to build your crate "multi-party-ecdsa" with the master version of curv in Git instead of its version form crates.io, , I receive the following "cargo check" output:

 Updating crates.io index
    Updating git repository `https://github.com/ZenGo-X/curv`
error: failed to select a version for `signature`.
    ... required by package `ecdsa v0.12.1`
    ... which satisfies dependency `ecdsa-core = "^0.12"` of package `p256 v0.9.0`
    ... which satisfies dependency `p256 = "^0.9"` of package `curv-kzen v0.9.0`
    ... which satisfies dependency `curv-kzen = "^0.9"` of package `bulletproof-kzen v1.2.0`
    ... which satisfies dependency `bulletproof-kzen = "^1.2"` of package `centipede v0.3.0`
    ... which satisfies dependency `centipede = "^0.3"` of package `multi-party-ecdsa v0.8.1 (/Users/oleg/Projects/multi-party-ecdsa)`
versions that meet the requirements `>=1.3.0, <1.4.0` are: 1.3.2, 1.3.1, 1.3.0

all possible versions conflict with previously selected packages.

  previously selected package `signature v1.5.0`
    ... which satisfies dependency `signature = ">=1.5, <1.7"` of package `ecdsa v0.14.4`
    ... which satisfies dependency `ecdsa-core = "^0.14"` of package `p256 v0.11.1`
    ... which satisfies dependency `p256 = "^0.11.1"` of package `curv-kzen v0.9.0 (https://github.com/ZenGo-X/curv#d733f376)`
    ... which satisfies git dependency `curv-kzen` of package `multi-party-ecdsa v0.8.1 (/Users/oleg/Projects/multi-party-ecdsa)`

failed to select a version for `signature` which could resolve this conflict

NB: Cleaning of .cargo/registry was performed.