Skip to content

Commit

Permalink
squash! refactor!: Pull Crypto trait to the high-level implementation
Browse files Browse the repository at this point in the history
The crypto-* features are removed from edhoc-rs; testing depends on
edhoc-crypto being pulled in in parallel to the test, and a feature
selected on that.
  • Loading branch information
chrysn committed Nov 15, 2023
1 parent 11123bf commit 7d9be6e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
strategy:
fail-fast: false
matrix:
crypto_backend: [crypto-hacspec, crypto-psa]
crypto_backend: [edhoc-crypto/hacspec, edhoc-crypto/psa]
ead: [ead-none, ead-zeroconf]

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Run unit tests # note that we only add `--package edhoc-hacspec` when testing the hacspec version of the lib
run: RUST_BACKTRACE=1 cargo test -p edhoc-rs -p edhoc-consts -p edhoc-ead-zeroconf --no-default-features --features="${{ matrix.crypto_backend }}, ${{ matrix.ead }}" --no-fail-fast -- --test-threads 1
run: RUST_BACKTRACE=1 cargo test -p edhoc-rs -p edhoc-crypto -p edhoc-consts -p edhoc-ead-zeroconf --no-default-features --features="${{ matrix.crypto_backend }}, ${{ matrix.ead }}" --no-fail-fast -- --test-threads 1


build-edhoc-package:
Expand All @@ -46,7 +46,7 @@ jobs:
strategy:
fail-fast: false
matrix:
crypto_backend: [crypto-hacspec, crypto-psa, crypto-psa-baremetal, crypto-cryptocell310]
crypto_backend: [edhoc-crypto/hacspec, edhoc-crypto/psa, edhoc-crypto/psa-baremetal, edhoc-crypto/cryptocell310]
ead: [ead-none, ead-zeroconf]

steps:
Expand Down
3 changes: 2 additions & 1 deletion examples/edhoc-rs-cc2538/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description = "edhoc-rs example on CC2538 SoC"

[dependencies]
edhoc-rs = { path = "../../lib", default-features = false }
edhoc-crypto = { path = "../../crypto", default-features = false }
# depend on an allocator
embedded-alloc = "0.5.0"
hexlit = "0.5.3"
Expand All @@ -20,5 +21,5 @@ rtt-target = { version = "0.3.1", features = ["cortex-m"] }

[features]
default = [ "psa" ]
psa = [ "edhoc-rs/crypto-psa-baremetal" ]
psa = [ "edhoc-crypto/psa-baremetal" ]

4 changes: 2 additions & 2 deletions examples/edhoc-rs-no_std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rtt-target = { version = "0.3.1", features = ["cortex-m"] }
[features]
default = [ "rtt", "crypto-cryptocell310", "ead-none" ]
rtt = [ ]
crypto-psa = [ "edhoc-rs/crypto-psa-baremetal" ]
crypto-cryptocell310 = [ "edhoc-rs/crypto-cryptocell310" ]
crypto-psa = [ "edhoc-crypto/psa-baremetal" ]
crypto-cryptocell310 = [ "edhoc-crypto/cryptocell310" ]
ead-none = [ "edhoc-rs/ead-none" ]
ead-zeroconf = [ "edhoc-rs/ead-zeroconf" ]
4 changes: 0 additions & 4 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ edhoc-crypto = { path = "../crypto", default-features = false }

[features]
default = [ "edhoc-ead/ead-none" ]
crypto-hacspec = ["hacspec-lib/std", "edhoc-crypto/hacspec" ]
crypto-psa = [ "edhoc-crypto/psa" ]
crypto-psa-baremetal = [ "edhoc-crypto/psa-baremetal", "panic-semihosting" ]
crypto-cryptocell310 = [ "edhoc-crypto/cryptocell310", "panic-semihosting" ]
ead-none = [ "edhoc-ead/ead-none" ]
ead-zeroconf = [ "edhoc-ead/ead-zeroconf" ]

Expand Down

0 comments on commit 7d9be6e

Please sign in to comment.