We made third! or Twofish on a smart card


In a practical course this summer term the task was to implement the twofish block-cipher, a former AES candidate, on an embedded device, a smart card with an ATMega163 microcontroller on board. A prize was promised for the team that has the best performance based on clock cycles per key schedule/encryption/decryption and code size. 3 weeks of time were given, 10 teams participated and we made third, yeah!

In particular, the main decision was to handle the S-Boxes. The S-Box keys are derived from the main key and can be precomputed. So the main questions was whether we save clock cycles and precompute them or compute them on-the-fly while running enrcyption/decryption and save SRAM in the microcontroller. We decided to precompute them, as this would bring our implementation a significant performance increase.

These are the statistics..


Statistics Diagram


Statistics Table

, , , ,

  1. #1 by CDW on September 29, 2011 - 08:44

    This looks like nice work. Are these implementations open-source?

  2. #2 by cordney* on October 11, 2011 - 07:17

    Of course they are. I added a notice to the post.

(will not be published)