AES CBC with nRF52832 using NCS

Hello,

I'm using nRF52832 custom board with nRF Connect SDK2.6.0

When I try to run AES CBC sample from ncs\v2.6.0\nrf\samples\crypto\aes_cbc, 

I got an error log:

*** Booting nRF Connect SDK d96769faceca ***
[00:00:00.382,934] <inf> aes_cbc: Starting AES-CBC-NO-PADDING example...
[00:00:00.382,934] <inf> aes_cbc: Generating random AES key...
[00:00:00.382,965] <inf> aes_cbc: psa_generate_key failed! (Error: -134)
[00:00:00.382,965] <inf> aes_cbc: Example exited with error!

But when I run the same application code build for nRF52840 dongle, it workrd.

How do I fix the code for my nrf52832?

[00:00:00.326,324] <inf> aes_cbc: Starting AES-CBC-NO-PADDING example...
[00:00:00.326,324] <inf> aes_cbc: Generating random AES key...
[00:00:00.326,477] <inf> aes_cbc: AES key generated successfully!
[00:00:00.326,507] <inf> aes_cbc: Encrypting using AES CBC MODE...
[00:00:00.326,782] <inf> aes_cbc: Encryption successful!
[00:00:00.326,812] <inf> aes_cbc: ---- IV (len: 16): ----
[00:00:00.326,843] <inf> aes_cbc: Content:
                                  7e 91 78 41 07 dc 61 8e  94 04 8d d1 98 aa 2a 51 |~.xA..a. ......*Q
[00:00:00.326,873] <inf> aes_cbc: ---- IV end  ----
[00:00:00.326,904] <inf> aes_cbc: ---- Plaintext (len: 64): ----
[00:00:00.326,934] <inf> aes_cbc: Content:
                                  45 78 61 6d 70 6c 65 20  73 74 72 69 6e 67 20 74 |Example  string t
                                  6f 20 64 65 6d 6f 6e 73  74 72 61 74 65 20 62 61 |o demons trate ba
                                  0m

Parents Reply Children
  • Hi Dejan,

    Thank you for the information. What I need to understand is whether AES encryption and decryption are possible on the nRF52832 using the nRF Connect SDK.

    As mentioned, I have successfully executed sample code on the previous nRF5 SDK, and since PCA10040 is the official development board from Nordic, I assume that AES cryptography should be supported on the nRF52832, correct?

    This is the sample code directory that I have successfully executed with my nRF52832 boarad.

    nRF5_SDK_17.1.0_ddde560\examples\crypto\nrf_crypto\aes\aes_cbc_with_padding\pca10040

     

    Best regards,

    Alan

  • Hi Alan,

    ekidsalan123 said:
    As mentioned, I have successfully executed sample code on the previous nRF5 SDK, and since PCA10040 is the official development board from Nordic, I assume that AES cryptography should be supported on the nRF52832, correct?

    This is correct. I was referring previously to the sample support in NCS. This means that the sample is not fully tested to be working on nrf52832, but it might work with some additional configuration. Documentation lists nrf52832 as supported for PSA Crypto. You can look at this discussion to get some idea what might be missing.

    Best regards,
    Dejan

Related