Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AES-CCM support and example #154

Merged
merged 5 commits into from
Jun 6, 2020
Merged

Conversation

thalesfragoso
Copy link
Contributor

Example Output
02:22:23.976 Starting Encryption of 251 bytes
02:22:23.976 Encryption Took: 178 us
02:22:23.976
02:22:23.976 Starting Decryption of 255 bytes
02:22:23.976 Decryption Took: 1118 us
02:22:23.976
02:22:23.976
02:22:23.976 Starting Encryption of 128 bytes
02:22:23.976 Encryption Took: 119 us
02:22:23.976
02:22:23.976 Starting Decryption of 132 bytes
02:22:23.976 Decryption Took: 608 us
02:22:23.976
02:22:23.976
02:22:23.976 Starting Encryption of 64 bytes
02:22:23.976 Encryption Took: 90 us
02:22:23.976
02:22:23.976 Starting Decryption of 68 bytes
02:22:23.976 Decryption Took: 341 us
02:22:23.976
02:22:23.976
02:22:23.976 Starting Encryption of 32 bytes
02:22:23.976 Encryption Took: 75 us
02:22:23.976
02:22:23.976 Starting Decryption of 36 bytes
02:22:23.976 Decryption Took: 208 us
02:22:23.976
02:22:23.976
02:22:23.976 Starting Encryption of 16 bytes
02:22:23.976 Encryption Took: 33 us
02:22:23.976
02:22:23.976 Starting Decryption of 20 bytes
02:22:23.976 Decryption Took: 109 us
02:22:23.976
02:22:23.976
02:22:23.976 Done

It seems that the peripheral holds itself during decryption, because it was made to operate on-the-fly with the radio, so it can't decrypt faster than the radio receives data.

@thalesfragoso
Copy link
Contributor Author

thalesfragoso commented Jun 4, 2020

Hmm, it seems that the nRF51 is only capable of encrypting payloads with lengths up to 27 bytes, that's unfortunate, I will try to fix this problem tomorrow.

We get an EasyDMA error if this shortcut is enabled and the
DataRateof the CCM is different from the one configured in the RADIO.
Copy link
Contributor

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

examples/ccm-demo/README.md Outdated Show resolved Hide resolved
examples/ccm-demo/src/stopwatch.rs Outdated Show resolved Hide resolved
nrf-hal-common/src/ccm.rs Outdated Show resolved Hide resolved
nrf-hal-common/src/ccm.rs Outdated Show resolved Hide resolved
nrf-hal-common/src/ccm.rs Outdated Show resolved Hide resolved
nrf-hal-common/src/ccm.rs Outdated Show resolved Hide resolved
nrf-hal-common/src/ccm.rs Outdated Show resolved Hide resolved
nrf-hal-common/src/ccm.rs Outdated Show resolved Hide resolved
nrf-hal-common/src/ccm.rs Show resolved Hide resolved
nrf-hal-common/src/ccm.rs Outdated Show resolved Hide resolved
@thalesfragoso
Copy link
Contributor Author

Thanks for the suggestions, updated.

@jonas-schievink jonas-schievink merged commit a04110c into nrf-rs:master Jun 6, 2020
@thalesfragoso thalesfragoso deleted the ccm-impl branch July 19, 2020 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants