Skip to content

Commit c4e7198

Browse files
authored
Merge pull request #10070 from holtrop-wolfssl/rust-rand_core-aead-cipher
Rust wrapper: add rand_core, aead, cipher trait implementations
2 parents c36beba + aa33d7b commit c4e7198

9 files changed

Lines changed: 2533 additions & 9 deletions

File tree

wrapper/rust/wolfssl-wolfcrypt/Cargo.lock

Lines changed: 102 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wrapper/rust/wolfssl-wolfcrypt/Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ readme = "README.md"
1212

1313
[features]
1414
std = []
15+
rand_core = ["dep:rand_core"]
16+
aead = ["dep:aead"]
17+
cipher = ["dep:cipher"]
18+
19+
[dependencies]
20+
rand_core = { version = "0.10", optional = true, default-features = false }
21+
aead = { version = "0.5", optional = true, default-features = false }
22+
cipher = { version = "0.5", optional = true, default-features = false }
23+
24+
[dev-dependencies]
25+
aead = { version = "0.5", features = ["alloc", "dev"] }
26+
cipher = "0.5"
1527

1628
[build-dependencies]
1729
bindgen = "0.72.1"

wrapper/rust/wolfssl-wolfcrypt/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
FEATURES := rand_core,aead,cipher
2+
CARGO_FEATURE_FLAGS := --features $(FEATURES)
3+
14
.PHONY: all
25
all:
3-
cargo build
4-
cargo clippy
5-
cargo doc
6+
cargo build $(CARGO_FEATURE_FLAGS)
7+
cargo clippy $(CARGO_FEATURE_FLAGS)
8+
cargo doc $(CARGO_FEATURE_FLAGS)
69

710
.PHONY: test
811
test:
9-
cargo test -- --test-threads=1
12+
cargo test $(CARGO_FEATURE_FLAGS) -- --test-threads=1
1013

1114
.PHONY: testfips
1215
testfips:
13-
cargo test --lib --bins --tests -- --test-threads=1
16+
cargo test $(CARGO_FEATURE_FLAGS) --lib --bins --tests -- --test-threads=1
1417

1518
.PHONY: clean
1619
clean:

0 commit comments

Comments
 (0)