Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 880 Bytes

README.md

File metadata and controls

20 lines (15 loc) · 880 Bytes

AES128 CCM code compatible with PSOC 4

Modified AES-128 CCM code for working with Cypress PSOC 4 encoding functions. Based on OpenSSL

Some Notes

  • PSOC4 uses AES-CCM 128 bits which is popular in BLE standard.
  • IV (=Initial Vector) is named "nonce" in PSOC terminology and is 13 bytes.
  • Tag is named MIC and is 4 bytes.
  • According to PSOC docs a {1} array should be used for AAD
  • Plaintext is the raw data. Its size is limited to 27 bytes in PSOC functions.

Here I use OpenSSL library. To install it on linux do the followings:

  1. Install the library:
  • sudo apt install libss-dev
  1. Find the location of installed library. On Ubuntu 18 and 20 {OPENSSL_LOCATION} = /usr/lib/x86_64-linux-gnu/
  • dpkg-query -L libssl-dev
  1. Add this parameters to GCC for compiling. You can use MakeFile as well:
  • gcc XXX.c XXXXX.c -L{OPENSSL_LOCATION} -lcrypto -lssl