Arduino DUE AES Encryption library, how to adopt libtomcrypt?

Hi,
Im looking for encryption library that can work with Arduino Due, there are few libs, but every of it working only on AVR's. I found very interesting and advanced library, TomCrypt libtom GitHub - libtom/libtomcrypt: LibTomCrypt is a fairly comprehensive, modular and portable cryptographic toolkit that provides developers with a vast array of well known published block ciphers, one-way hash functions, chaining modes, pseudo-random number generators, public key cryptography and a plethora of other routines. But unfortunatly it needs few changes to adopt to work as a Arduino library. I dont have any experiences with that and im looking for some who can help me with it, or generally adopt this libs to Arduino to help our community
Regards

If you want to integrate it into the libraries folder then the following steps worked for me:

  • Unpack the zip file in the Arduino libraries folder.
  • Go into the top level folder of the unpacked library and create a library.properties with something like this (you can put more sensible values in if you want):
name=TomCrypt
version=1.0.0
author=Tom
maintainer=xxx
sentence=xxx
paragraph=xxx
category=Device Control
url=xxx
architectures=*
include=tomcrypt.h

More details on the properties file here.

  • Now a dirty hack: copy all the headers files from the src/header folder into the src/ folder. The Arduino build environment expects public headers to be there.
  • Now another dirty hack, but only because I don’t know why it is necessary and it may not be the best place for it: Edit src/tomcrypt_custom.h, after the include guard, add a new line #define LTC_SOURCE
    I don’t know what LTC_SOURCE means, but it is not defined anywhere and without it a few bits and bobs aren’t available.
  • Restart your Arduino IDE and include the library in a small test sketch to compile everything. This is what I used, but I have no idea how to use the library - it was just a quick and dirty test:
#include <tomcrypt.h>

symmetric_key mskey;
  
void setup() {
  if (rijndael_setup((const unsigned char *)"my key", 6, 6, &mskey)) { }
}

void loop() { }

If it now compiles - well done. I haven’t tested anything more since I don’t have a Due and don’t really want to figure out how to use the library properly anyway.