Giter Site home page Giter Site logo

crypto-bench's People

Contributors

axelnennker avatar briansmith avatar frewsxcv avatar hauleth avatar johnheitmann avatar ranweiler avatar samscott89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

crypto-bench's Issues

Add x86_64-pc-windows-msvc and i686-pc-windows-msvc configurations

Unfortunately, crypto-bench doesn't build on pc-windows-msvc now because several of the libraries fail to build. As Cargo.toml only supports adding dependencies per-target, not removing them, that means we'd need to add an exhaustive set of configurations to Cargo.toml in order to get this to work. Hopefully the instead the libraries will soon improve so that they build and work correctly on pc-windows-msvc.

Publish results somewhere

It would be nice to have place to send people from Reddit asking about performance of crypto in Rust.

Add ECDSA verification benchmarks

Most immediately, we need to benchmark ring against OpenSSL for the P-256 and P-384 curves on x86-64 (Haswell and later).

ECDSA verification isn't (necessarily) a constant-time operation; the speed of the verification may depend on the value of the public key and/or the value of the signature (r, s). We know that ring and recent versions of OpenSSL currently use a constant-time implementation for P-256 verification. ring uses a constant-time implementation for P-384 too, but OpenSSL uses a variable-time implementation. Therefore, we need to use multiple public keys and multiple signatures for each public key in the benchmark. This makes the benchmarking more difficult than what we do for other algorithms, where we assume that the values of the inputs don't affect the timing.

Add rust-nettle (nettle) benchmarks

There is a rust-nettle crate, so that should help.

Nettle is a very interesting library that implements a few things in a very interesting way, differently than many crypto libraries (Rust or C or otherwise) do them. It even has assembly-language-optimized P-384, which almost nobody else bothers with! So, it might very well be faster than everything else, at least in some benchmarks.

@johnschug Do you have any tips for using your rust-nettle crate? the goal here is to measure its performance relative to the other libraries being benchmarked in this crate.

Adding new primitives/constructions?

I was wondering whether crypto-bench would accept adding implementations of other primitives/constructions than those listed in the README? Things like BLAKE2*, etc.

I was also wondering if the the ChaCha20-Poly1305 benchmark-listing, in the README, cover a XChaCha20-Poly1305 implementation? I'm asking because sodiumoxide is listed to have benchmarks for Salsa20-Poly1305, when in fact it calls a XSalsa20-Poly1305 implementation.

Add iOS Securtiy Framework (Common Crypto, etc.) benchmarks

It would be useful to see how Rust-implemented crypto libraries compare, performance-wise, to the native crypto APis in Mac OS X and especially on iOS. In particular, this would help crypto library authors decide whether to defer some or all algorithms to the OS on OS X and/or iOS. Especially since code size is a significant issue on iOS, there's a lot of incentive to use the native code if it performs well and is correct.

I don't know of any Rust bindings for Common Crypto, so either (a) the initial benchmarks can be in C, or (b) some bindings need to be made.

Stop pulling crates from github

Just an issue I ran into when using this repository is that it references the github repo for a number of crates. Various projects use various methods working with git and its quite likely that at any given time one of the git HEADs will be broken or may induce breaking changes since this crate has been updated. In my case, tests for the ring crate failed but switching to the most recent crates.io release resolved all issues.

In addition to avoiding potentially broken master branches, using crates.io releases is also much more representative of expected performance as most people are not going to be linking against the GitHub repository.

Add RSA verification benchmarks

Most immediately, we need to compare ring and OpenSSL performance. I'll merge #20 and then we can build on top of that.

For now, we only need to measure the case where the public key has e == 67737 and where the length of n is {2048, 3072, 4096} bits.

RSA verification is not (necessarily) a constant-time operation, so there might be some timing variance for different public keys. But the timing variance is mostly in the value of e, so if we fix that, we should be able to get meaningful numbers for ring and OpenSSL, given what we know about how their modular multiplication and exponentiation primitives are implemented.

If we determine that there are further timing variances between public keys, we can improve the tests later in a separate bug/PR.

Add Windows Crypto API (CNG and maybe CAPI) benchmarks

It would be useful to see how Rust-implemented crypto libraries compare, performance-wise, to the native crypto APis in Windows. In particular, this would help crypto library authors decide whether to defer some or all algorithms to the OS on Windows.

I don't know of any Rust bindings for these APIs, so either (a) the initial set of benchmarks can be in C, or (b) some bindings need to be made.

Add ease-of-installation benchmark

For implementations that can be installed by just adding a dependency in Cargo.toml (ring, octavo, rust-crypto), this won't change anything.

Other implementations that require manual installation steps should become optional dependencies and should be off by default, enabled with a feature flag. In order to run the benchmarks, the user will have to learn and perform the manual installation steps first. This way, the benchmark runner can measure qualitatively and quantitatively the usability of the library as far as installation is concerned.

This is would be a very useful benchmark because ease-of-use is a key factor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.