UMAC C Source Technical Notes ============================= Contents -------- 1. ANSI C source can be forced... 2. Alignment of data... ----------------------------------------------------------------------------- 1. ANSI C source can be forced by setting the ANSI_C_ONLY preprocessor macro. If the macro is not set then specialized code is compiled under a few different compilers for Intel x86 and PowerPC. The level of support is different under each compiler, as indicated in the following table Rotate Endian NH-Asm PRF-Asm x86 ppc x86 ppc x86 ppc x86 ppc GCC Y Y Y Y Y N* Y N MSVC Y - Y - Y - N - MWERKS N Y N Y Y N* N N MSVC = Microsoft Visual C++ 6.0 GCC = GNU C Compiler (gcc) 2.7 MWERKS = Metrowerks C Compiler 2.3 N* = UMAC-MMX for ppc uses AltiVec C intrinsics if available. "Rotate" indicates that the processor's rotate instruction is forced. "Endian" indicates that the processor's fast byteswapping instruction is forced. "NH-Asm" and "PRF-Asm" indicate that the hash or PRF functions are written in the compiler's inline-assembly dialect. UMAC-MMX for x86 assumes the target processor supports MMX instructions unless ANSI_C_ONLY has been set. The specialized code for each compiler may work on newer and/or older versions, but this has not been tested. ----------------------------------------------------------------------------- 2. Alignment of data to be processed is important for correctness and maximum performance. Register loads to MMX registers from memory which are not aligned to an 8 byte boundary incur a significant penalty. Register loads to AltiVec regsters from memory not aligned to a 16 byte boundary result in incorrect execution of UMAC. For best performance pass UMAC buffers which are aligned to 16 byte boundaries and when passing buffers to "umac_update()" pass buffers of length divisible by 16 for all buffers except the last. These precautions will also avoid potential misaligned access faults on processors that cannot handle misaligned data. ----------------------------------------------------------------------------- UMAC C Source Revision History ============================== Version 0.25.05 -- 1999 JULY 28 - Added support for Visual C++ - Fixed bug in NH-STD where intermediate additions were not MOD 2^32 - Corrected opad/ipad constants in HMAC-SHA for UMAC-STD PRF. - Eliminated most unsigned types. Now only used to force logical shifts. ----------------------------------------------------------------------------- This file was last modified on 28 July 1999.