GithubHelp home page GithubHelp logo

Compilling for ESP32 about arduinolibs HOT 13 OPEN

rweather avatar rweather commented on July 28, 2024
Compilling for ESP32

from arduinolibs.

Comments (13)

rweather avatar rweather commented on July 28, 2024 1

I have added some macros to #define my class names to something else to try to work around the system headers.

The long-term solution is for esp-idf to rename their enumerations to ESP_AES128, etc so that the system headers don't pollute the global namespace with generic names.

from arduinolibs.

rweather avatar rweather commented on July 28, 2024

Weird. I just tried to recompile it with my setup: Arduino 1.8.2 and the "ESP32 Dev Module" board type. It seems to compile OK, so maybe it is something to do with the older 1.6.7 IDE?

The ESP32 version of the AES code tries to use the hardware cryptography module inside the ESP32. You can temporarily disable it by changing the following lines at the top of AES.h:

#if defined(ESP32)
#define CRYPTO_AES_ESP32 1
#else
#define CRYPTO_AES_DEFAULT 1
#endif

Change them to simply:

#define CRYPTO_AES_DEFAULT 1

I hope this helps.

from arduinolibs.

Macrosii avatar Macrosii commented on July 28, 2024

Thanks very much for such a prompt reply. I installed IDE 1.8.7 fresh on my laptop, the ESP32 core from board manager any your library under usr/documennts/arduino/libraries/Crypto/.
OS is Windows 7 Premium

I get the same error with #define CRYPTO_AES_DEFAULT 1 or #define CRYPTO_AES_ESP32 1.
I renamed the ESP aes.h in hwcrpto and it complains its missing with CRYPTO_AES_ESP32 1, as expected.
There must be something strange with my ESP32 setup or install. It compiles with all the other boards I have tried. I will try asking on the Arduino forums. So far searching on error: 'XXXX' does not name a type seems to be missing files, but that is not the case here. If i find a solution i will post back. thanks

from arduinolibs.

Macrosii avatar Macrosii commented on July 28, 2024

Should I post the debug output here ? its 152 lines ?

from arduinolibs.

Macrosii avatar Macrosii commented on July 28, 2024

aes_compile error.zip

Compile output - verbose.

from arduinolibs.

rweather avatar rweather commented on July 28, 2024

I notice that the sketch you are compiling is called TestAESsteal.ino. Can you check the includes at the top of the file? At the very least you will need:

#include <Crypto.h>
#include <AES.h>

The Crypto.h is important - the Arduino IDE needs that to know which library to include (Crypto) before looking for the other files.

from arduinolibs.

Macrosii avatar Macrosii commented on July 28, 2024

Yes it just your AES example slightly modified where I wanted to see what happens to the decrypted text if you change one byte of the cypher text.
TestAESsteal.zip
. first 3 lines are

#include <Crypto.h>
#include <AES.h>
#include <string.h>

It complies for most board tyes, just the ESP32 boards give the error.

from arduinolibs.

Macrosii avatar Macrosii commented on July 28, 2024

FYI
To rule out a Windows 7 issue I installed fresh on my wife's Windows 10 machine.
IDE 1.8.7
ESP32 core 1.0.0
Library installed to /usr/documents/arduino/libraries/Crypto
Compile example /Crypto/examples/TestAES/TestAES.ino

Same issue, compiles ok for other board types but gives the same error above for ESP32.
If I find a solution I will post back.
Regards

from arduinolibs.

LQ1234 avatar LQ1234 commented on July 28, 2024

I believe this is the same issue I am having with my arduino nano 33 ble. In both, crypto.h and aes.h are already defined:
NANO:
https://github.com/arduino/ArduinoCore-nRF528x-mbedos/blob/master/cores/arduino/mbed/features/mbedtls/mbed-crypto/inc/mbedtls/aes.h
https://github.com/arduino/ArduinoCore-nRF528x-mbedos/blob/master/cores/arduino/mbed/features/mbedtls/mbed-crypto/inc/psa/crypto.h

ESP:
https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/wpa_supplicant/crypto/crypto.h
https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/esp32/rom/aes.h

Not sure what to do about it tho

from arduinolibs.

LQ1234 avatar LQ1234 commented on July 28, 2024

I put the lib into src/ and imported it like this:
#include "src/Crypto/Crypto.h"
#include "src/Crypto/AES.h"
You guys have a easier api tho

from arduinolibs.

rweather avatar rweather commented on July 28, 2024

I may have to consider renaming the class in my library since so many other libraries seem to be using "AES128" and "AES256" now too. I was hoping not to have to do that. :-(

from arduinolibs.

ortegafernando avatar ortegafernando commented on July 28, 2024

Hi, I have the same problem. how do I have to solve it? Thanks. (esp32)

from arduinolibs.

ln-12 avatar ln-12 commented on July 28, 2024

I can approve that the problem persists for me. I think the compiler gets the AES128 type from some other imports in the project, so renaming might be the safest solution.

... /Crypto/AES.h:247:9: error: 'AES128' does not name a type

I have (for now) solved it, by renaming AES128, AES192 and AES256 from here.

from arduinolibs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.