diff --git a/rc4/Cargo.toml b/rc4/Cargo.toml index 1c5523ef..a0f28a40 100644 --- a/rc4/Cargo.toml +++ b/rc4/Cargo.toml @@ -16,6 +16,7 @@ description = "Pure Rust implementation of the RC4 stream cipher" cipher = { version = "0.5", features = ["stream-wrapper"] } [dev-dependencies] +cipher = { version = "0.5", features = ["dev"] } hex-literal = "1" [features] diff --git a/rc4/benches/mod.rs b/rc4/benches/mod.rs new file mode 100644 index 00000000..74cd1fd1 --- /dev/null +++ b/rc4/benches/mod.rs @@ -0,0 +1,16 @@ +//! Basic benchmarks +#![feature(test)] +extern crate test; + +cipher::stream_cipher_bench!( + // TODO: use `Key:` option instead after macro is fixed upstream + Init: { + use cipher::KeyInit; + let key = test::black_box(Default::default()); + rc4::Rc4::::new(&key) + }; + rc4_bench1_16b 16; + rc4_bench2_256b 256; + rc4_bench3_1kib 1024; + rc4_bench4_16kib 16384; +);