Comments (13)
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.
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.
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.
Should I post the debug output here ? its 152 lines ?
from arduinolibs.
Compile output - verbose.
from arduinolibs.
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.
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.
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.
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.
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.
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.
Hi, I have the same problem. how do I have to solve it? Thanks. (esp32)
from arduinolibs.
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)
- Use of htobe64 and other non-standard functions HOT 3
- Encrypt String longer than blockSize() HOT 5
- Asymmetric encryption/decryption? HOT 3
- Error compiling for new Arduino core for the ESP32 HOT 4
- Support for XChaCha20 Poly1305 HOT 2
- Need help with ChaCha and Strings HOT 1
- TestSpeck.ino fails on samd21 M0 after changing the plaintext HOT 1
- Asymmetric encryption HOT 1
- Including libraries does not work in platformio HOT 1
- default key? HOT 4
- Bug of Ascon128.c++ in Arduino Cryptography Library HOT 3
- TestSpeck.ino - Decryption fails for SpeckTiny with all key sizes HOT 1
- Crypto doesn't support next generation AVRs HOT 18
- ’SHA256‘ was not declared in this scope ESP32S3 HOT 6
- Crypto library "Hash.h" conflicting with ESP866 Arduino package "Hash.h" HOT 5
- Ascon128::decrypt doesn't seem to allow for inplace decryption, despite documentation saying so
- Support for SHA-512/256?
- crypto_feed_watchdog was not declared in this scope [ESP8266 & ESP32] HOT 3
- RNG.cpp include of <Arduino.h> makes native builds for unit testing and debugging fail
- Error Compiling for ESP8266 or ESP32 clean() not declared in scope AES CFB example
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinolibs.