Skip to content

Commit da322a3

Browse files
authored
aucpace: test with cargo hack (#201)
Ensure the build works with all feature combinations
1 parent 554b60a commit da322a3

File tree

6 files changed

+30
-7
lines changed

6 files changed

+30
-7
lines changed

.github/workflows/aucpace.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@ jobs:
4949
- uses: dtolnay/rust-toolchain@master
5050
with:
5151
toolchain: ${{ matrix.rust }}
52+
- uses: RustCrypto/actions/cargo-hack-install@master
53+
- run: cargo hack test --feature-powerset
5254
- run: cargo test --release --all-features

aucpace/src/server.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ where
334334
/// ([`next_step`](AuCPaceServerCPaceSubstep), [`message`](ServerMessage::AugmentationInfo))
335335
/// - [`next_step`](AuCPaceServerCPaceSubstep): the server in the `CPace` substep stage
336336
/// - [`message`](ServerMessage::AugmentationInfo): the message to send to the client
337-
///
338337
#[cfg(all(feature = "strong_aucpace", feature = "partial_augmentation"))]
339338
pub fn generate_client_info_partial_strong<U, DB, CSPRNG>(
340339
self,
@@ -812,7 +811,11 @@ mod tests {
812811
}
813812
}
814813

815-
#[cfg(all(feature = "sha2", feature = "strong_aucpace"))]
814+
#[cfg(all(
815+
feature = "partial_augmentation",
816+
feature = "sha2",
817+
feature = "strong_aucpace"
818+
))]
816819
impl PartialAugDatabase for FakeDatabase {
817820
type PrivateKey = Scalar;
818821
type PublicKey = RistrettoPoint;
@@ -858,7 +861,12 @@ mod tests {
858861
}
859862

860863
#[test]
861-
#[cfg(all(feature = "sha2", feature = "rand", feature = "strong_aucpace"))]
864+
#[cfg(all(
865+
feature = "partial_augmentation",
866+
feature = "sha2",
867+
feature = "rand",
868+
feature = "strong_aucpace"
869+
))]
862870
fn test_server_doesnt_accept_invalid_uq_partial() {
863871
use crate::utils::H0;
864872
use curve25519_dalek::traits::Identity;

aucpace/tests/test_key_agreement.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(all(feature = "alloc", feature = "rand"))]
2+
13
use aucpace::{
24
Client, ClientMessage, Database, OsRng, Result, Server, ServerMessage,
35
client::{AuCPaceClientPreAug, AuCPaceClientRecvServerKey},

aucpace/tests/test_key_agreement_partial_aug.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
use aucpace::OsRng;
2-
use aucpace::client::{AuCPaceClientPreAug, AuCPaceClientRecvServerKey};
3-
use aucpace::server::{AuCPaceServerAugLayer, AuCPaceServerRecvClientKey};
1+
#![cfg(all(feature = "alloc", feature = "partial_augmentation", feature = "rand"))]
2+
43
use aucpace::{
5-
Client, ClientMessage, Database, Error, PartialAugDatabase, Result, Server, ServerMessage,
4+
Client, ClientMessage, Database, Error, OsRng, PartialAugDatabase, Result, Server,
5+
ServerMessage,
6+
client::{AuCPaceClientPreAug, AuCPaceClientRecvServerKey},
7+
server::{AuCPaceServerAugLayer, AuCPaceServerRecvClientKey},
68
};
79
use curve25519_dalek::{RistrettoPoint, Scalar};
810
use password_hash::{ParamsString, SaltString};

aucpace/tests/test_key_agreement_strong.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(all(feature = "alloc", feature = "rand", feature = "strong_aucpace"))]
2+
13
use aucpace::{
24
Client, ClientMessage, OsRng, Result, Server, ServerMessage, StrongDatabase,
35
client::{AuCPaceClientPreAug, AuCPaceClientRecvServerKey},

aucpace/tests/test_key_agreement_strong_partial_aug.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#![cfg(all(
2+
feature = "alloc",
3+
feature = "partial_augmentation",
4+
feature = "rand",
5+
feature = "strong_aucpace"
6+
))]
7+
18
use aucpace::{
29
Client, ClientMessage, Error, OsRng, PartialAugDatabase, Result, Server, ServerMessage,
310
StrongDatabase,

0 commit comments

Comments
 (0)