From 180b8d173e1baa1b3f435c95bcb5f818ec0c7ce3 Mon Sep 17 00:00:00 2001 From: chrysn Date: Wed, 15 Nov 2023 20:08:44 +0100 Subject: [PATCH] fixup! refactor!: Pull Crypto trait to the high-level implementation --- examples/edhoc-rs-no_std/src/main.rs | 32 ++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/examples/edhoc-rs-no_std/src/main.rs b/examples/edhoc-rs-no_std/src/main.rs index f1994a4d..f588d1a1 100644 --- a/examples/edhoc-rs-no_std/src/main.rs +++ b/examples/edhoc-rs-no_std/src/main.rs @@ -74,7 +74,13 @@ fn main() -> ! { fn test_new_initiator() { let state = Default::default(); - let _initiator = EdhocInitiator::new(state, I, CRED_I, Some(CRED_R)); + let _initiator = EdhocInitiator::new( + state, + edhoc_crypto::default_crypto(), + I, + CRED_I, + Some(CRED_R), + ); } test_new_initiator(); @@ -94,7 +100,13 @@ fn main() -> ! { fn test_prepare_message_1() { let state = Default::default(); - let mut initiator = EdhocInitiator::new(state, I, CRED_I, Some(CRED_R)); + let mut initiator = EdhocInitiator::new( + state, + edhoc_crypto::default_crypto(), + I, + CRED_I, + Some(CRED_R), + ); let c_i: u8 = generate_connection_identifier_cbor().into(); let message_1 = initiator.prepare_message_1(c_i); @@ -106,9 +118,21 @@ fn main() -> ! { fn test_handshake() { let state_initiator = Default::default(); - let mut initiator = EdhocInitiator::new(state_initiator, I, CRED_I, Some(CRED_R)); + let mut initiator = EdhocInitiator::new( + state_initiator, + edhoc_crypto::default_crypto(), + I, + CRED_I, + Some(CRED_R), + ); let state_responder = Default::default(); - let responder = EdhocResponder::new(state_responder, R, CRED_R, Some(CRED_I)); + let responder = EdhocResponder::new( + state_responder, + edhoc_crypto::default_crypto(), + R, + CRED_R, + Some(CRED_I), + ); let c_i: u8 = generate_connection_identifier_cbor().into(); let (initiator, message_1) = initiator.prepare_message_1(c_i).unwrap(); // to update the state