user46162: I'm looking for AES128 library with CMAC for Arduino. Help me to find one

user30175: I happen to know some libraries which use this. AES128-CMAC is for example used in the LoRaWAN MAC / driver implementation (LoRa is a low-power-wide-range radio technology). For example, the library Arduino-LMIC (LoRa MAC in C) uses this AES-CMAC implementation (has actually 2 built-in, Ideetron is the other one):

https://github.com/matthijskooijman/arduino-lmic/tree/master/src/aes

Other stacks use the mbedtls library with only the AES and CMAC layer activated. The library, written by ARM, is entirely in C and thus easily configrable (config.h) and compilable for the Arduino platform:

https://github.com/ARMmbed/mbedtls
https://github.com/ARMmbed/mbedtls/blob/development/library/cmac.c

Semetech's LoRa stack even has AES and CMAC abstracted in 4 four files:

https://github.com/arduino-org/arduino-library-lora-node-shield/tree/master/src/system/crypto

Another good point would be to search PlatformIO's library index for "AES CMAC". Then this library comes up:

https://platformio.org/lib/search?query=AES%20CMAC
https://github.com/DavyLandman/AESLib

This also offers a CMAC implementation specifically designed for the Atmel AVR MCUs (Arduino Uno and likes) and partially written in Assembler. This should be best suited for you.

https://github.com/DavyLandman/AESLib/blob/master/bcal-cmac.c


46162: <p>I'm looking for <strong><em>AES128</em></strong> library with <strong><em>CMAC</em></strong> for Arduino. Help me to find one</p>
 30175: <p>I happen to know some libraries which use this. AES128-CMAC is for example used in the LoRaWAN MAC / driver implementation (LoRa is a low-power-wide-range radio technology). For example, the library Arduino-LMIC (<strong>L</strong>oRa <strong>M</strong>AC <strong>i</strong>n <strong>C</strong>) uses this AES-CMAC implementation (has actually 2 built-in, Ideetron is the other one):</p>

<ul>
<li><a href="https://github.com/matthijskooijman/arduino-lmic/tree/master/src/aes" rel="nofollow noreferrer">https://github.com/matthijskooijman/arduino-lmic/tree/master/src/aes</a></li>
</ul>

<p>Other stacks use the mbedtls library with only the AES and CMAC layer activated. The library, written by ARM, is entirely in C and thus easily configrable (<code>config.h</code>) and compilable for the Arduino platform:</p>

<ul>
<li><a href="https://github.com/ARMmbed/mbedtls" rel="nofollow noreferrer">https://github.com/ARMmbed/mbedtls</a></li>
<li><a href="https://github.com/ARMmbed/mbedtls/blob/development/library/cmac.c" rel="nofollow noreferrer">https://github.com/ARMmbed/mbedtls/blob/development/library/cmac.c</a></li>
</ul>

<p>Semetech's LoRa stack even has AES and CMAC abstracted in 4 four files:</p>

<ul>
<li><a href="https://github.com/arduino-org/arduino-library-lora-node-shield/tree/master/src/system/crypto" rel="nofollow noreferrer">https://github.com/arduino-org/arduino-library-lora-node-shield/tree/master/src/system/crypto</a></li>
</ul>

<p>Another good point would be to search PlatformIO's library index for "AES CMAC". Then this library comes up:</p>

<ul>
<li><a href="https://platformio.org/lib/search?query=AES%20CMAC" rel="nofollow noreferrer">https://platformio.org/lib/search?query=AES%20CMAC</a></li>
<li><a href="https://github.com/DavyLandman/AESLib" rel="nofollow noreferrer">https://github.com/DavyLandman/AESLib</a></li>
</ul>

<p>This also offers a CMAC implementation specifically designed for the Atmel AVR MCUs (Arduino Uno and likes) and partially written in Assembler. This should be best suited for you.</p>

<ul>
<li><a href="https://github.com/DavyLandman/AESLib/blob/master/bcal-cmac.c" rel="nofollow noreferrer">https://github.com/DavyLandman/AESLib/blob/master/bcal-cmac.c</a></li>
</ul>
