-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from franziskuskiefer/0.0.5
0.0.5
- Loading branch information
Showing
14 changed files
with
151 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,32 @@ jobs: | |
run: | | ||
cd evercrypt-rs | ||
cargo bench --verbose --features rust-crypto-aes | ||
fuzz: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-latest | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
default: true | ||
- uses: actions-rs/[email protected] | ||
with: | ||
crate: cargo-fuzz | ||
version: latest | ||
- name: Fuzz AEAD | ||
run: | | ||
cd evercrypt-rs | ||
cargo fuzz run aead -- -runs=1000000 | ||
- name: Fuzz ECDH | ||
run: | | ||
cd evercrypt-rs | ||
cargo fuzz run ecdh -- -runs=1000000 |
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,7 +1,7 @@ | ||
[workspace] | ||
members = [ | ||
"evercrypt-rs", | ||
"evercrypt-sys" | ||
"evercrypt-sys", | ||
] | ||
|
||
[patch.crates-io] | ||
|
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,6 +1,6 @@ | ||
[package] | ||
name = "evercrypt" | ||
version = "0.0.4" | ||
version = "0.0.5" | ||
authors = ["Franziskus Kiefer <[email protected]>"] | ||
edition = "2018" | ||
license = "MPL-2.0" | ||
|
@@ -22,7 +22,7 @@ random = ["rand", "rand_core"] | |
serialization = ["serde", "serde_json"] | ||
|
||
[dependencies] | ||
evercrypt-sys = { version = "0.0.4" } | ||
evercrypt-sys = { version = "0.0.5" } | ||
aes-gcm = { version = "0.8", optional = true } | ||
rand = { version = "0.7", optional = true } | ||
rand_core = { version = "0.5", optional = true } | ||
|
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,4 @@ | ||
|
||
target | ||
corpus | ||
artifacts |
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,35 @@ | ||
|
||
[package] | ||
name = "evercrypt-fuzz" | ||
version = "0.0.0" | ||
authors = ["Automatically generated"] | ||
publish = false | ||
edition = "2018" | ||
|
||
[package.metadata] | ||
cargo-fuzz = true | ||
|
||
[dependencies] | ||
libfuzzer-sys = "0.3" | ||
|
||
[dependencies.evercrypt] | ||
path = ".." | ||
|
||
[patch.crates-io] | ||
evercrypt-sys = { path = "../../evercrypt-sys" } | ||
|
||
# Prevent this from interfering with workspaces | ||
[workspace] | ||
members = ["."] | ||
|
||
[[bin]] | ||
name = "ecdh" | ||
path = "fuzz_targets/ecdh.rs" | ||
test = false | ||
doc = false | ||
|
||
[[bin]] | ||
name = "aead" | ||
path = "fuzz_targets/aead.rs" | ||
test = false | ||
doc = false |
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,30 @@ | ||
#![no_main] | ||
use libfuzzer_sys::fuzz_target; | ||
|
||
use evercrypt::prelude::*; | ||
|
||
fuzz_target!(|data: &[u8]| { | ||
let modes = [ | ||
AeadMode::Aes128Gcm, | ||
AeadMode::Aes256Gcm, | ||
AeadMode::Chacha20Poly1305, | ||
]; | ||
for &mode in modes.iter() { | ||
let nonce = aead_nonce_gen(mode); | ||
let enc_result = aead_encrypt(mode, data, data, &nonce, &[]); | ||
let (c, t) = if let Ok((c, t)) = enc_result { | ||
(c, t) | ||
} else { | ||
if data.len() != 16 { | ||
return; | ||
} | ||
let mut tag = [0u8; 16]; | ||
tag.clone_from_slice(data); | ||
(data.to_vec(), tag) | ||
}; | ||
let dec_result = aead_decrypt(mode, data, &c, &t, &nonce, &[]); | ||
if let Ok(ptxt) = dec_result { | ||
assert_eq!(ptxt, data); | ||
} | ||
} | ||
}); |
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,9 @@ | ||
#![no_main] | ||
use libfuzzer_sys::fuzz_target; | ||
|
||
use evercrypt::prelude::*; | ||
|
||
fuzz_target!(|data: &[u8]| { | ||
let _ = ecdh_derive(EcdhMode::X25519, data, data); | ||
let _ = ecdh_derive_base(EcdhMode::X25519, data); | ||
}); |
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,6 +1,6 @@ | ||
[package] | ||
name = "evercrypt-sys" | ||
version = "0.0.4" | ||
version = "0.0.5" | ||
authors = ["Franziskus Kiefer <[email protected]>"] | ||
edition = "2018" | ||
build = "build.rs" | ||
|
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
Submodule hacl-star
updated
from 1e5134 to d88c75