Home

Awesome

<p align="center"> <h1 align="center">starkware-crypto-rs</h1> </p>

Rust FFI bindings for StarkWare's crypto-cpp library

linting-badge tests-unix-badge tests-windows-badge crates-badge

Note that currently target x86_64-pc-windows-msvc is not supported. If you're building on Windows, you need to use the GNU build of Rust.

Using starknet-crypto instead

Due to a few known issues with this library:

you're advised to use starknet-crypto instead, which is pure-Rust implementation of the same low-level cryptography functions, with better performance and portability.

Adding starkware-crypto-rs to your project

Still want to use starkware-crypto-rs? To use the crate from crates.io, add the following to your Cargo.toml file:

[dependencies]
starkware-crypto-sys = "0.1"

Running benchmark

To run benchmark:

$ cargo bench

On the author's machine with Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz running Ubuntu 20.04.2 LTS:

ecdsa_get_public_key    time:   [4.1132 ms 4.1567 ms 4.2157 ms]
ecdsa_sign              time:   [185.54 ms 186.31 ms 187.20 ms]
ecdsa_verify            time:   [1.5582 ms 1.5708 ms 1.5853 ms]
pedersen_hash           time:   [293.27 us 294.74 us 296.33 us]

License

Licensed under either of

at your option.