-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ao-then-get-ready-for-the-fast-div
* master: uint: faster mul by u64 (#125) fix rocksdb block cache size (#122) uint: convert benchmarks to criterion (#123) Bump fixed-hash to 0.3.2 (#134) Use EntropyRng instead of OsRng (#130) Bump parity-crypto to 0.3.1 (#132) rust-crypto dependency removal (#85) Use newly stablized TryFrom trait for primitive-types (#127)
- Loading branch information
Showing
17 changed files
with
487 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
[package] | ||
name = "parity-crypto" | ||
version = "0.3.0" | ||
version = "0.3.1" | ||
authors = ["Parity Technologies <admin@parity.io>"] | ||
repository = "https://github.com/paritytech/parity-common" | ||
description = "Crypto utils used by ethstore and network." | ||
license = "GPL-3.0" | ||
autobenches = false | ||
|
||
[[bench]] | ||
name = "bench" | ||
harness = false | ||
|
||
|
||
[dependencies] | ||
quick-error = "1.2.2" | ||
ring = "0.14.3" | ||
rust-crypto = "0.2.36" | ||
tiny-keccak = "1.4" | ||
scrypt = { version = "0.1.1", default-features = false } | ||
ripemd160 = "0.8.0" | ||
sha2 = "0.8.0" | ||
digest = "0.8" | ||
aes = "0.3.2" | ||
aes-ctr = "0.3.0" | ||
block-modes = "0.3.3" | ||
ring = "0.14.6" | ||
|
||
[dev-dependencies] | ||
criterion = "0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright 2015-2018 Parity Technologies (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
extern crate parity_crypto; | ||
|
||
#[macro_use] | ||
extern crate criterion; | ||
|
||
use criterion::{Criterion, Bencher}; | ||
|
||
criterion_group!(benches, input_len); | ||
|
||
criterion_main!(benches); | ||
|
||
/// general benches for multiple input size | ||
fn input_len(c: &mut Criterion) { | ||
|
||
c.bench_function_over_inputs("ripemd", | ||
|b: &mut Bencher, size: &usize| { | ||
let data = vec![0u8; *size]; | ||
b.iter(|| parity_crypto::digest::ripemd160(&data[..])); | ||
}, | ||
vec![100, 500, 1_000, 10_000, 100_000] | ||
); | ||
|
||
c.bench_function_over_inputs("aes_ctr", | ||
|b: &mut Bencher, size: &usize| { | ||
let data = vec![0u8; *size]; | ||
let mut dest = vec![0; *size]; | ||
let k = [0; 16]; | ||
let iv = [0; 16]; | ||
|
||
b.iter(||{ | ||
parity_crypto::aes::encrypt_128_ctr(&k[..], &iv[..], &data[..], &mut dest[..]).unwrap(); | ||
// same as encrypt but add it just in case | ||
parity_crypto::aes::decrypt_128_ctr(&k[..], &iv[..], &data[..], &mut dest[..]).unwrap(); | ||
}); | ||
}, | ||
vec![100, 500, 1_000, 10_000, 100_000] | ||
); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.