This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

AES CCM: can INPTR = OUTPTR?

Hello:

I have read the documentation but I cannot determine if INPTR and OUTPTR can be set to the same memory address? I will try it to see what happens but it would be great to know if this is supported.

FYI: I want to do on-the-fly packet encryption. I want to set PACKETPTR in the radio peripheral to the same value as both INPTR and OUTPTR in the CCM peripheral. This way I dont have to have different buffers (saves memory).

Thanks!

  • Bjorn:

    Thanks! I will do so... BTW I figured out the answer to my question. You CANNOT set INPTR to OUTPTR. I finally got the LL_START_ENC_RSP correctly encrypted with the proper MIC. I had to set INPTR and OUTPTR to different RAM locations. When they were the same the encryption worked but the MIC was incorrect. I would still like verification from your engineers on this one. Maybe I am not doing something else correctly? Anyway, as I move along I will post other questions on a different thread.

  • If you set the pointers to the same value, output data will overwrite input data, but it may be that the overwriting happens after data is read, but this has not been verified. Judging by your results, this is not a viable option.

    I discussed this with our R&D engineers and this was their reply:

    For Tx, Radio PACKETPTR should point to where OUTPTR (encrypted packet) points to. INPTR (clear text) should point to a different location.

    For Rx, INPTR should point to where Radio PACKETPTR points to. OUTPTR (clear text) should point to a different location.

    -Bjørn

Related