kildom / avr-aes Goto Github PK
View Code? Open in Web Editor NEWAES cipher implementation for 8-bit AVR microcontrollers
License: GNU General Public License v3.0
AES cipher implementation for 8-bit AVR microcontrollers
License: GNU General Public License v3.0
Nice to have:
In systems where key may be stored in flash or eeprom memory it can be beneficial to use pre-expanded key. It can be read from flash or eeprom directly, so less RAM will be used and key expansion will not be executed each time. This applies to all implementations.
User need to generate the expanded key. It should be possible to do it in following ways:
Larger key sizes can be added into SMALL implementation without a big effort. It requires more rounds and improved (or completely new) addRoundKey
function. Each key size should be independently enabled/disabled.
There are two options how to do a new API:
One release ZIP should be available with implementation that can be released under BSD license. BSD branch can be deleted.
Add extern "C" { ... }
for C++ compatibility.
Setting AES_SHORTSBOX
or AES_SHORTINVSBOX
is causing variable time of encrypting and decrypting. In some situations it may lead to vulnerability to side channel attacks (timing attack). Faster and smaller implementation (variable time) should be used as a default.
Documentation must contains information about that vulnerability.
It is not convenient for user to have both configuration and code inside one file. They have to be split.
Implementations based on external sources contains not so small changes, so using by
is not precise enough. Better expression will be based on
. This applies to source code comments and documentation.
Place Rcon
into local variables and pass it as a first parameter to key handling functions. Assign returned value back to Rcon
, e.g.:
byte Rcon;
...
Rcon = aesAddRoundKey(Rcon, state, key);
README.TXT should contain more detailed description. Following things should be added or improved:
Code style (mostly indentation) is inconsistent. Reformatting is required. Also some link to code style guaidlines should be added into README.
Release script should do following things:
Add block modes:
Message padding should also be considered.
stdint.h
type definitions are commonly used, so they are more understandable than some custom made for this project only.
Investigate one more implementation focused on small footprint TINY
. Commonly executed operations may be grouped into functions and executed by a very simple VM. Actual implementation will be inside a bytecode.
This should be optional. By default stack allocated memory is used, but user should have ability to switch to old behavior to reduce footprint.
How to do it:
LDI some_temp_reg, offset; RCALL loadTempBufPtr
and loadTempBufPtr: IN Ylo, SPL; IN Yhi, SPH; ADD Ylo, some_temp_reg; LDI some_temp_reg, 0; ADC Yhi, some_temp_reg; RET
loadTempBufPtr
may also load SPL into some_temp_reg: LDI some_temp_reg, SPL
. After call to this function some_temp_reg may be adjusted by ADD
instruction and used in loops conditions, e.g. ADD some_temp_reg, offset; ... ; cp Ylo, some_temp_reg
Combining everything in single .c file makes it less readable and maintainable. aes.c
should be split into separate files .c/.h files for each implementation of the cipher and one common .h or .inc file. Release files can contains auto-generated combined .c/.h pair.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.