Skip to content

Commit

Permalink
example: uncomment psa memory buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ElsaLopez133 committed Nov 2, 2024
1 parent 978bcd4 commit 0fac1f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions examples/lakers-nrf52840/src/bin/initiator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ async fn main(spawner: Spawner) {
info!("init_handshake");

// Memory buffer for mbedtls
// #[cfg(feature = "crypto-psa")]
// let mut buffer: [c_char; 4096 * 2] = [0; 4096 * 2];
// #[cfg(feature = "crypto-psa")]
// unsafe {
// mbedtls_memory_buffer_alloc_init(buffer.as_mut_ptr(), buffer.len());
// }
#[cfg(feature = "crypto-psa")]
let mut buffer: [c_char; 4096 * 2] = [0; 4096 * 2];
#[cfg(feature = "crypto-psa")]
unsafe {
mbedtls_memory_buffer_alloc_init(buffer.as_mut_ptr(), buffer.len());
}

let cred_i = Credential::parse_ccs(common::CRED_I.try_into().unwrap()).unwrap();
let cred_r = Credential::parse_ccs(common::CRED_R.try_into().unwrap()).unwrap();
Expand Down
12 changes: 6 additions & 6 deletions examples/lakers-nrf52840/src/bin/responder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ async fn main(spawner: Spawner) {
radio.set_crc_poly(CRC_POLY);

// Memory buffer for mbedtls
// #[cfg(feature = "crypto-psa")]
// let mut buffer: [c_char; 4096 * 2] = [0; 4096 * 2];
// #[cfg(feature = "crypto-psa")]
// unsafe {
// mbedtls_memory_buffer_alloc_init(buffer.as_mut_ptr(), buffer.len());
// }
#[cfg(feature = "crypto-psa")]
let mut buffer: [c_char; 4096 * 2] = [0; 4096 * 2];
#[cfg(feature = "crypto-psa")]
unsafe {
mbedtls_memory_buffer_alloc_init(buffer.as_mut_ptr(), buffer.len());
}

loop {
let mut buffer: [u8; MAX_PDU] = [0x00u8; MAX_PDU];
Expand Down

0 comments on commit 0fac1f0

Please sign in to comment.