Fhreefish - fast AVR 8-bit implementation of Threefish and Skein
This project is a library for the popular Atmel AVR 8-bit microcontrollers. It implements a high-performance version of the Skein hashing algorithm, one of the candidates for the upcoming SHA-3 standard. The algorithm was designed by a group of experienced cryptanalysts, most notably including Bruce Schneier
There is already an implementation of Skein and the associated Threefish encryption algorithm as part of AVR-Crypto-Lib. While that library is feature-complete and offers all sizes/modes, it doesn't even remotely meet the performance estimate presented in the Skein specification. For this reason, I have reimplemented the core threefish algorithm in highly optimized assembler. The Threefish primitive runs in about 8800 cycles, 700 less than estimated.
Features / Specifications
- Threefish-256 encryption and decryption
- Skein-256-256 hashing
- optional hash personalization
- cryptographically secure PRNG based on Skein
- not reentrant, but interrupt safe
- fast:
- Threefish in 8800 cycles
- Skein in 18500 cycles for short messages
- 290 cycles per byte for long messages
- PRNG in 310 cycles per byte (for big amounts)
- no separate key setup required -- included in the above figures
- reasonable code size: 7.5kiB for all features, 2.5kiB for encryption only
- low memory usage: about 100 bytes including storage for input and output text
- message size up to 2^32-1
- AVR-GCC C API and calling convention
- zero-copy operation and in-place hashing/encryption available
- buildable in AVR Studio or via GNU make
- documentation in fkein.h and fhreefish.h
- readable assembler source code
- licensed under the GNU General Public License version 3
History
- Version 1.2.1
- Fix PRNG. Now really works like the specification suggests. Consequently, speed is a lot faster as well.
- Version 1.2
- Initial public release.