tests
directory should help.
pregen/gnu
.
asm.h
which contains some macros that the C preprocessor can use to convert
the *.S
files into raw assembly suitable for your local
setup. asm.h
is in the pregen/h
directory.
pregen/h/clink.h
provides a header file to link
the assembly functions with C or C++ code.
pregen/masm_inl/fastcall
.
pregen/h/clink.h
is a header file that
that can be used when linking these C functions with C or C++ code.
pregen/watcom/register
if you would like
to use register calling conventions and in pregen/watcom/stack
if you would like to use stack based calling conventions.
pregen/h/clink.h
provides a header file to link
the assembly functions with C or C++ code.
pregen/masm_inl/cdecl
for C files containing inline MASM syntax
assembly, and pregen/watcom/stack
for WASM syntax assembly
files using __cdecl
calling conventions.
Note that WASM is supposed to be
a subset of MASM, so the latter files should work with any MASM compatiable
assembler.
pregen/h/clink.h
provides a header file to link
the assembly or C functions with C or C++ code.
config.gnu
in the base directory, to make
sure that the macros EXESUFFIX
and ASMFORMAT
make sense for your platform. (They are configured for a Linux, ELF,
gas system by default.)
cd asmgen
and execute make -f makefile.gnu
.
This should produce a set of *.S
files that can
be translated by your assembler into object files.
*.S
files into object files using your
choosen assembler.
clink.h
provides a header file to link
the assembly functions with C or C++ code.
cd asmgen
and execute nmake /f makefile.ms
.
This should produce a set of *.c
files containing
inline assembly code that MSVC++ can compile into object files.
clink.h
provides a header file to link
the assembly functions with C or C++ code.
ASMFORMAT
in config.wat
in the base directory. This macro should equal
wasm-register
if you want to build functions that will
be linkable with C using the register calling conventions. If you
would like to use functions linkable using the __cdecl
(stack)
calling conventions select wasm-cdecl
instead.
cd asmgen
and execute wmake /f makefile.wat
.
This should produce a set of *.asm
files that can
be translated by WASM into object files.
clink.h
.
asmgen
directory.
No advanced C++ is used, so hopefully any decent C++ compiler will be able
to translate the *.cpp
into object files without a problem.
cmd5.cpp
,
asmgen.cpp
, md5g.cpp
and a2r128.cpp
together to create
the program cmd5
. Repeat, substituting
"rmd128" for "md5" to create the program crmd128
.
csha0.cpp
,
shag.cpp
, sha0g.cpp
,
asmgen.cpp
, and a2r160.cpp
together to create
the program csha0
. Repeat, substituting "sha1" for "sha0"
to create the programs csha1
.
crmd160.cpp
,
rmd160.cpp
,
asmgen.cpp
, and a2r160.cpp
together to create
the program crmd160
.
cmd5
for a usage summary. (Note that
wasm-cdecl should produce a file that MASM compatiable assemblers
can translate into C linkable object files.)
cmd5
with the desired assembly format
as an option and redirect the output to create
assembly files or C files with inline assembly as appropriate.
crmd128
,
crmd160
, csha0
, and csha1
.
clink.h
.
config.gnu
in the base directory to make
sure that the macros EXESUFFIX
, ASSEMBLER
,
ASMOUT
, and ASMFORMAT
make sense for your platform. (They are configured for a Linux, ELF,
gas system by default.)
make -f makefile.gnu install
to make
a local installation under the base directory.
make -f makefile.gnu correct
to perform
a correctness check on the library.
make -f makefile.gnu speed
to see the cycle counts for the compression functions.
include/chnhash
to an
appropriate location for your system.
lib/libch.a
can now be moved to an
appropriate location for your system.
nmake -f makefile.ms install
to make
a local installation under the base directory.
nmake -f makefile.ms correct
to perform
a correctness check on the library.
nmake -f makefile.ms speed
to see the cycle counts for the compression functions.
include/chnhash
to an
appropriate location for your system.
lib/ch.lib
can now be moved to an
appropriate location for your system.
ASMFORMAT
in config.wat
in the base directory. This macro should equal
wasm-register
if you want to build functions that will
be linkable with C using the register calling conventions. If you
would like to use functions linkable using the __cdecl
(stack)
calling conventions select wasm-cdecl
instead.
CPPFLAGS
are consistent with the above choice: Use /5r for
register calling conventions and /5s for stack calling conventions.
wmake -f makefile.wat install
to make
a local installation under the base directory.
wmake -f makefile.wat correct
to perform
a correctness check on the library.
wmake -f makefile.wat speed
to see the cycle counts for the compression functions.
include/chnhash
to an
appropriate location for your system.
lib/ch.lib
can now be moved to an
appropriate location for your system.
asmgen/chtypes.h
.
chmisc.inl
to access
the i486+'s BSwap instruction which does endianness reversal.
test/speed/gettsc.inl
to access the Pentium's RDTSC instruction which reads the cycles count
since power up.
If you think you can work around the above areas, the remainder of the port should be fairly easy, since this library does not use advanced C++ features.
chnhash
.
asmgen/clink.h
to
the chnhash
directory.
chnhash
. Make sure that
the base directory is on your include path when you do this.
lib
in the base directory.
chnhash/*.h
, chnhash/*.hpp
,
and chnhash/*.inl
to the directory include
under
the base directory.
cd
into
tests
to try out the correctness and speed tests.