Next Previous Table of Contents

C Linkable Functions

Overview

This section is intended for those who wish to extract the core assembly functions used by this library for use outside of the C++ wrapper. An example of such use might be as part of a C library. Those who want to use the C++ wrapper, on the other hand, can safely regard these functions as private and skip this section. (Note: I have assumed that anyone trying to extract my assembly functions for use outside their C++ wrapper is already familiar with these one-way hash functions. If this is not the case, please consult the definitive papers.)

xxxTransform

void xxxTransform(u32* H, const u32* X);
This is the "template" for using the compression functions provided. "xxx" can be any one of MD5, SHA0, SHA1, RIPEMD128, or RIPEMD160. Before calling the compression function, H must point to the chain variables before application of the compression function. For MD5, the correspondence between chain variables and the values in the block of memory pointed at by H is
H[0]=a, H[1]=b, H[2]=c, and H[3]=d.
For the other compression functions, the correspondence is
H[i]=Hi.
If the block to be compressed is
b[0]b[1]b[2]b[3]...b[60]b[61]b[62]b[63]
the bytes must be stored in memory, starting at the location pointed at by X, as
b[0]b[1]b[2]b[3]...b[60]b[61]b[62]b[63].
Since the Pentium is a low endian architecture, this implies that
X[0]=b[3]b[2]b[1]b[0],
X[1]=b[7]b[6]b[5]b[4],
...
X[15]=b[63]b[62]b[61]b[60].
Upon return, H will point to the updated values of the chain variables.
Next Previous Table of Contents