Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose a testing crate #68

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ evercrypt_provider/target
no-std-support-check/target
rust_crypto_provider/target
traits/target/
hpke-rs-tests/target
.DS_Store
/.idea
25 changes: 25 additions & 0 deletions hpke-rs-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "hpke-rs-tests"
version = "0.1.0"
authors = [ "Cryspen" ]
edition = "2021"
license = "MPL-2.0"
readme = "Readme.md"
description = "Tests for crypto providers"
repository = "https://github.com/franziskuskiefer/hpke-rs"
franziskuskiefer marked this conversation as resolved.
Show resolved Hide resolved

[dependencies]
hpke-rs = { version = "0.2.0", features = [
"hazmat",
"serialization",
"hpke-test",
], path = "../" }
hpke-rs-crypto = { version = "0.2.0", path = "../traits" }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
rayon = "1.5"
log = "0.4"
pretty_env_logger = "0.5"

[features]
prng = ["hpke-rs/hpke-test-prng"]
24 changes: 24 additions & 0 deletions hpke-rs-tests/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Tests for Crypto Providers

This crate exposes macros that define crypto provider test functions.

## Usage

```rust
struct MyCryptoProvider;

impl hpke_rs_crypto::CryptoProvider for MyCryptoProvider {
// ...
}

#[cfg(tests)]
mod tests {
// the tests names are close to the spec and don't follow rust conventions
#![allow(non_snake_case)]

use super::MyCryptoProvider;

hpke_rs_tests::test_funs!(MyCryptoProvider);
hpke_rs_tests::kat_fun!(MyCryptoProvider);
}
```
9 changes: 9 additions & 0 deletions hpke-rs-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pub mod test_hpke;
pub mod test_hpke_kat;

pub use hpke_rs;
pub use hpke_rs_crypto;
pub use serde;
pub use serde_json;

mod util;
Loading
Loading