All Projects → aadomn → aes

aadomn / aes

Licence: MIT license
Fast constant-time AES implementations on 32-bit architectures

Programming Languages

assembly
5116 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to aes

nats
A program to hide file into executable binary.
Stars: ✭ 16 (-63.64%)
Mutual labels:  aes
yarvi
Yet Another RISC-V Implementation
Stars: ✭ 59 (+34.09%)
Mutual labels:  risc-v
tinyaes-py
tiny-AES-c wrapper in Cython
Stars: ✭ 33 (-25%)
Mutual labels:  aes
vega-lite
Software, tools, and documentation for RV32-VEGA-Lite platform
Stars: ✭ 61 (+38.64%)
Mutual labels:  risc-v
chat-diffie-hellman
A secure chat between an Android client and Java server using AES for encryption and Diffie-Hellman for key exchange.
Stars: ✭ 26 (-40.91%)
Mutual labels:  aes
WebRISC-V
WebRISC-V: A Web-Based Education-Oriented RISC-V Pipeline Simulation Environment [PHP]
Stars: ✭ 74 (+68.18%)
Mutual labels:  risc-v
cryptorious
CLI Password Manager
Stars: ✭ 15 (-65.91%)
Mutual labels:  aes
riscv em
Simple risc-v emulator, able to run linux, written in C.
Stars: ✭ 51 (+15.91%)
Mutual labels:  risc-v
fos
Interesting project,the Fast Real Time Operating Systems( FOS-RTOS)
Stars: ✭ 22 (-50%)
Mutual labels:  risc-v
KyogenRV
The Simple 5-staged pipeline RISC-V written in chisel3 for intel FPGA.
Stars: ✭ 37 (-15.91%)
Mutual labels:  risc-v
cortexm-AES
high performance AES implementations optimized for cortex-m microcontrollers
Stars: ✭ 18 (-59.09%)
Mutual labels:  aes
epater
An ARM emulator in Python for educational purposes
Stars: ✭ 27 (-38.64%)
Mutual labels:  arm-assembly
sedna
Sedna - a pure Java RISC-V emulator.
Stars: ✭ 52 (+18.18%)
Mutual labels:  risc-v
java-sdk
一些常用的java sdk和工具类(日期工具类,分布式锁,redis缓存,二叉树,反射工具类,线程池,对称/非对称/分段加解密,json序列化,http工具,雪花算法,字符串相似度,集合操作工具,xml解析,重试Retry工具类,Jvm监控等)
Stars: ✭ 26 (-40.91%)
Mutual labels:  aes
Reverse-Engineering
A FREE comprehensive reverse engineering tutorial covering x86, x64, 32-bit ARM & 64-bit ARM architectures.
Stars: ✭ 7,234 (+16340.91%)
Mutual labels:  arm-assembly
yatcpu
Yet another toy CPU.
Stars: ✭ 42 (-4.55%)
Mutual labels:  risc-v
ravel
A RISC-V simulator
Stars: ✭ 24 (-45.45%)
Mutual labels:  risc-v
K210
Kendryte K210 BSP for RT-Thread
Stars: ✭ 15 (-65.91%)
Mutual labels:  risc-v
webcrypto
A WebCrypto Polyfill for NodeJS
Stars: ✭ 111 (+152.27%)
Mutual labels:  aes
Xassette-Asterisk
Evaluation board for AllWinner's RISC-V 64 SoC F133/D1s
Stars: ✭ 168 (+281.82%)
Mutual labels:  risc-v

Fast constant-time AES implementations on 32-bit architectures

This repository contains efficient constant-time implementations for the Advanced Encryption Standard (AES) algorithm as supplementary material for the paper Fixslicing AES-like Ciphers - New bitsliced AES speed records on ARM Cortex-M and RISC-V published in TCHES 2021/1.

Structure of the repository

The repository structure is as follows:

aes
│   README.md
│   LICENSE   
│
├───armcortexm
│   ├───1storder_masking
│   ├───barrel_shiftrows
│   └───fixslicing
│   
├───opt32
│   ├───barrel_shiftrows
│   └───fixslicing
│   
├───riscv
│   ├───barrel_shiftrows
│   └───fixslicing

where armcortexm and riscv directories respectively refer to assembly implementations for ARM Cortex-M and RV32I, whereas opt32 refers to C language implementations. Note that the main goal of the opt32 directory is to provide cross-platform implementations and to serve a didactic purpose. Therefore if you intend to run it for benchmarking, you should consider some modifications regarding execution speed.

AES representations

Each directory includes two different AES representations:

  • barrel_shiftrows

    Processes 8 blocks in parallel. Requires 1408 and 1920 bytes to store all the round keys for AES-128 and AES-256, respectively.

  • fixslicing

    Processes 2 blocks in parallel. Requires 352 and 480 bytes to store all the round keys for AES-128 and AES-256, respectively. Two fixsliced versions are proposed:

    • Fully-fixsliced: faster but at the cost of a larger code size
    • Semi-fixsliced: slightly slower but more compact.

Performance

Since the fixsliced representations require 4 times less RAM to store all the round keys, they are more suited to the most resource-constrained platforms. Still, the barrel-shiftrows representation might be worthy of consideration for use-cases that deal with large amount of data on architectures with numerous general-purpose registers (e.g. RV32I). The table below summarizes the performance of each version on ARM Cortex-M3 and E31 RISC-V processors in cycles per byte. Note that those implementations are non-unrolled to ensure greater clarity and limit the impact on code size. Unrolling them would result in slightly better performance and we refer to the paper for more details.

Algorithm Parallel blocks ARM Cortex-M3 E31 RISC-V core
AES-128 semi-fixsliced 2 87.1 93.4
AES-128 fully-fixsliced 2 84.3 89.3
AES-128 barrel-shiftrows 8 94.8 78.9
AES-256 semi-fixsliced 2 119.9 128.4
AES-256 fully-fixsliced 2 115.6 122.4
AES-256 barrel-shiftrows 8 127.9 105.7

First-order masking

A first-order masked implementation based on fixslicing can be found in armcortexm/1storder_masking. The masking scheme is the one described in the article Masking the AES with Only Two Random Bits and is strongly based on the code from the corresponding repository. Note that the code in charge of the randomness generation is specific to the STM32F407VG development board and some changes would be necessary to run it on another board (e.g. adapting the RNG_SR address). The table below summarizes their performance on ARM Cortex-M4 in cycles per byte. Once again, results can be slightly enhanced by unrolling the code.

Algorithm Parallel blocks ARM Cortex-M4
1st-order masked AES-128 semi-fixsliced 2 199.3
1st-order masked AES-128 fully-fixsliced 2 195.8

⚠️🚨 This masking scheme was mainly introduced to achieve first-order masking while limiting the amount of randomness to generate. Please be aware that other first-order masking schemes provide a better security level. Note that no practical evaluation has been undertaken to assess the security of our masked implementations! 🚨⚠️

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].