spaniakos / AES

AES for microcontrollers (Arduino & Raspberry pi)
http://spaniakos.github.io/AES/
GNU Affero General Public License v3.0
126 stars 55 forks source link

Compile error with Arduino 1.6.4 #1

Closed DrakeClark closed 7 years ago

DrakeClark commented 8 years ago

Thanks for a great 8 bit AES library!

I'm getting two simple errors on AES.cpp:

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,
                 from C:\Program Files (x86)\Arduino\libraries\AES-master\AES_config.h:19,
                 from C:\Program Files (x86)\Arduino\libraries\AES-master\AES.h:4,
                 from C:\Program Files (x86)\Arduino\libraries\AES-master\AES.cpp:1:
C:\Program Files (x86)\Arduino\libraries\AES-master\AES.cpp:68:27: error: variable 's_fwd' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 static byte s_fwd [0x100] PROGMEM =
                           ^
C:\Program Files (x86)\Arduino\libraries\AES-master\AES.cpp:88:27: error: variable 's_inv' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 static byte s_inv [0x100] PROGMEM =
                           ^
Error compiling.

This error can be corrected by declaring s_fwd and s_inv to as "const". Thanks.

spaniakos commented 8 years ago

Thank you for your notes I will include the submission in the near future. On Feb 10, 2016 06:12, "Drake Clark" notifications@github.com wrote:

Thanks for a great 8 bit AES library!

I'm getting two simple errors on AES.cpp:

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0, from C:\Program Files (x86)\Arduino\libraries\AES-master\AES_config.h:19, from C:\Program Files (x86)\Arduino\libraries\AES-master\AES.h:4, from C:\Program Files (x86)\Arduino\libraries\AES-master\AES.cpp:1: C:\Program Files (x86)\Arduino\libraries\AES-master\AES.cpp:68:27: error: variable 's_fwd' must be const in order to be put into read-only section by means of 'attribute((progmem))' static byte s_fwd [0x100] PROGMEM = ^ C:\Program Files (x86)\Arduino\libraries\AES-master\AES.cpp:88:27: error: variable 's_inv' must be const in order to be put into read-only section by means of 'attribute((progmem))' static byte s_inv [0x100] PROGMEM = ^ Error compiling.

This error can be corrected by declaring s_fwd and s_inv to as "const". Thanks.

— Reply to this email directly or view it on GitHub https://github.com/spaniakos/AES/issues/1.

tscha70 commented 5 years ago

static ...

is now ...

const byte s_fwd [0x100] PROGMEM = {

... correct?

spaniakos commented 5 years ago

seems fine does it compile ?