Skip to main content

Software Implementation of digest function

Long Nguyen

Abstract

This compressed file contains some example files to support the paper "Short-output universal hash functions and their use in fast and secure message authentication" by Long Hoang Nguyen and Andrew William Roscoe and to appear in the 19th Proceedings of the International Workshop on Fast Software Encryption or FSE 2012, in 19-21 March 2012, Washington DC, USA. The following C files are software implementations of MMH, NH and digest() with respect to different output lengths. Please note that to get accurate speeds when being run on different computers, the speed of the computer must be set correctly in the main() function of the files, the speed variable is called "hz". So at the moment, our workstation is a 1GHz AMD Athlon(tm) 64 X2 Dual Core Processor (4600+ or 512 KB caches) running the 2.6.30 Linux kernel, and hence the speed is hz = 10^9 (or 1GHz). All of these files are written in the style of Krovetz et al. for implementation of UMAC. Please see "http://fastcrypto.org/umac/" For digest functions: Digest32.c – 32-bit digest() Digest64.c – 64-bit digest() Digest96.c – 96-bit digest() Digest160.c – 160-bit digest() Digest256.c – 256-bit digest() For MMH: MMH32.c MMH64.c MMH96.c MMH160.c MMH256.c For NH: NH64.c NH128.c NH192.c NH320.c NH512.c For 32-bit digest(), 32-bit MMH and 64-bit NH all together in one file: MMH-NH-Digest-32.c When being compiled and run, they will give the speeds in cycles per byte (cpb) of MMH, NH and digest() where the lengths of input data are 8, 32, 256 and 1024 Kilobytes. The only two other files needed for universal hash key generation are Paulo Barreto's version of rijndael-alg-fst.c and rijndael-alg-fst.h both of which are included in the directory or can be easily found in the public domain. This above C files can be compiled by the following command: gcc -O3 -o output file.c rijndael-alg-fst.h rijndael-alg-fst.c To run it: ./output ========================================== For example: To compile Digest32.c please type: gcc -O3 -o output Digest32.c rijndael-alg-fst.h rijndael-alg-fst.c To run: ./output and the result looks like below in our workstation Speed of 32-bit output digest(k,m) Digesting 8192 byte messages: 0.53 cpb. Digesting 32768 byte messages: 0.51 cpb. Digesting 262144 byte messages: 0.50 cpb. Digesting 1048576 byte messages: 0.50 cpb.

Year
2012