Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
879e0cb1
Unverified
Commit
879e0cb1
authored
6 years ago
by
Koen Zandberg
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #10406 from jcarrano/aes-t-table
sys/crypto: optimize AES footprint (resurrected)
parents
836fe3db
3393dafe
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
makefiles/pseudomodules.inc.mk
+5
-0
5 additions, 0 deletions
makefiles/pseudomodules.inc.mk
sys/crypto/aes.c
+425
-346
425 additions, 346 deletions
sys/crypto/aes.c
sys/crypto/doc.txt
+7
-0
7 additions, 0 deletions
sys/crypto/doc.txt
sys/include/crypto/aes.h
+0
-3
0 additions, 3 deletions
sys/include/crypto/aes.h
with
437 additions
and
349 deletions
makefiles/pseudomodules.inc.mk
+
5
−
0
View file @
879e0cb1
...
...
@@ -127,4 +127,9 @@ PSEUDOMODULES += skald_eddystone
# define optimized read function of DS18 driver as a pseudo module
PSEUDOMODULES
+=
ds18_optimized
# By using this pseudomodule, T tables will be precalculated.
PSEUDOMODULES
+=
crypto_aes_precalculated
# This pseudomodule causes a loop in AES to be unrolled (more flash, less CPU)
PSEUDOMODULES
+=
crypto_aes_unroll
# Packages may also add modules to PSEUDOMODULES in their `Makefile.include`.
This diff is collapsed.
Click to expand it.
sys/crypto/aes.c
+
425
−
346
View file @
879e0cb1
This diff is collapsed.
Click to expand it.
sys/crypto/doc.txt
+
7
−
0
View file @
879e0cb1
...
...
@@ -47,6 +47,13 @@
*
* @endcode
*
* Some aspects of the AES implementation can be fine tuned by pseudo-modules:
* * crypto_aes_precalculated: Use pre-calculated T-tables. This improved
* speed at the expense of increased program size. The default is to
* calculate most tables on the fly.
* * crypto_aes_unroll: enable manually-unrolled loops. The default is to not
* have them unrolled.
*
* If you need to encrypt data of arbitrary size take a look at the different
* operation modes like: CBC, CTR or CCM.
*
...
...
This diff is collapsed.
Click to expand it.
sys/include/crypto/aes.h
+
0
−
3
View file @
879e0cb1
...
...
@@ -37,9 +37,6 @@ typedef uint32_t u32;
typedef
uint16_t
u16
;
typedef
uint8_t
u8
;
/* This controls loop-unrolling in aes_core.c */
#undef FULL_UNROLL
# define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ \
((u32)(pt)[2] << 8) ^ ((u32)(pt)[3]))
# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment