nrf-hal
nrf-hal copied to clipboard
Enable CCM demo to work on nrf51
Signed-off-by: Daniel Egger [email protected]
nRF51 devices only support payloads of up to 27 bytes.
Maybe we should change the example to use smaller payloads, I remember that I used those sizes because I wanted to try some bench-marking. Since I already included the example as a "benchmark" (see stopwatch.rs) maybe we should use some cfg
s also on the buffer size.
Huh? Where does that quoted comment come from? 😅
From the docs: https://github.com/nrf-rs/nrf-hal/blob/af83e6ed69c5ec03b1e0f6b4adae53258f57e83a/nrf-hal-common/src/ccm.rs#L40
And from the manual:
Encryption (Page 121):
The AES CCM is limited to read maximum 27 bytes of the unencrypted payload (PL) regardless of what is specified in the length field of the unencrypted packet.
Decryption (Page 122):
The AES CCM is limited to read maximum 27 bytes of the encrypted payload and four bytes of the MIC regardless of what is specified in the length field of the encrypted packet.
I'll modify the example to use less payload on nrf51 when I find time (or someone beats me to it 😉 ).