v4.2 Documentation
Introduction
This second implementation available in the DPA contest v4 is an improved version of the first implementation (AES RSM) implemented in software on an Atmel ATMega-163 smart card. This new implementation corrects several leaks identified in the previous one. In addition, in response to several comments we received, we revert to a 128-bit key.
The main changes between v4.1 and this v4.2 are:
- The 128-bit key version of AES is selected, thence traces can contain a complete encryption
- Each state byte has its own mask (4 bit entropy)
- Shuffling
- Fully written in assembly language
- Register transfers checked carefully against self-demasking (i.e., the flaw identified in this ACNS '14 paper is fixed)
The formal description of this implementation is available in this paper (PDF) (Analysis and Improvements of the DPA Contest v4 Implementation, SPACE '14, LNCS 8804, Springer, Pune, India, October 18-22, 2014).
Update July 20, 2015: Contrary to what is written in the above description on page 4, the mask set used in the corrected implementation below is [0x03, 0x0c, 0x35, 0x3a, 0x50, 0x5f, 0x66, 0x69, 0x96, 0x99, 0xa0, 0xaf, 0xc5, 0xca, 0xf3, 0xfc]
Important update (August 27, 2015): An error has been detected (thanks to Zdeněk Martinásek et Liran Lerman) in the implementation used to perform the acquisitions for the DPA contest v4.2 (AES-128 Improved RSM). Due to a bug, the permutation function Shuffle10 is used before the first round instead of Shuffle0. We sincerely want to apologize for the inconvenience.
Implementation
This archive contains all the details of the implementation of the DPA contest v4.2 on the Atmel ATMega-163 smart card (this archive has been updated on July 20, 2015).
The important files in this archive are:
- The directory bin contains the code loaded into the smartcard:
- dpa4.hex: the content of the flash memory of the ATMega-163 card
- eedata.hex: the content of the EEPROM memory of the ATMega-163 card
- The directory src contains the source code
ATmega163
Some documents about the microcontroller ATmega163 that runs the v4.2 implementation:
- The datasheet of the Atmel ATmega163
- The AVR Instruction Set (the description of all the instructions of the microcontroller)
Credits
The implementation uses some portions of code from external projects and developers:
- Simple Operating System for Smartcard Education, Copyright (C) 2002 Matthias Bruestle <m@mbsks.franken.de>, Under GPL v2
- AVR-Crypto-Lib, Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de), Under GPL v3
- iomacros.h, Copyright (C) 1999 Marek
Michalkiewicz
Acquisitions
To be added soon...