#include <FXSecure.h>
This is an implementation of the Tiger fast hashing algorithm by Ross Anderson and Eli Biham. This hash algorithm outputs a 192 bit hash (as a FX::Secure::TigerHashValue) and is suitable for use in cryptography. At the time of writing (August 2003) no known faults exist within it, though because it is relatively new (1996) this may change.
The advantages of this algorithm over others such as SHA-1 though are substantial. It works in 64 bit quantities which means all current PC memory architectures work to their best and with the introduction of 64 bit processors shortly, this is set to improve still further. Tiger is also fast, from the same to three times as fast as SHA-1. It is also much more non-linear than more conventional hash algorithms so that each bit of input has a much quicker propagation effect on the hash bits. However it also uses a brand-new method of generation and thus potential weaknesses are less well known. See http://www.cs.technion.ac.il/~biham/ and http://www.cl.cam.ac.uk/users/rja14/ for more information.
Users should note that this implementation is biased in favour of little endian architectures and is only as good as the compiler can make it (though significant use is made of code inlining and custom versions for 32 & 64 bit architectures).
Public Member Functions | |
TigerHash (FXuint passes=3) | |
FXuint | passes () const throw () |
void | setPasses (FXuint passes) throw () |
TigerHashValue | calc (FXuchar *buffer, FXuval length) const throw () |
FX::Secure::TigerHash::TigerHash | ( | FXuint | passes = 3 |
) | [inline] |
Constructs an instance.
FXuint FX::Secure::TigerHash::passes | ( | ) | const throw () [inline] |
Returns the number of passes used.
void FX::Secure::TigerHash::setPasses | ( | FXuint | passes | ) | throw () [inline] |
Sets the number of passes to be used (default is 3, use higher values for more security).
TigerHashValue FX::Secure::TigerHash::calc | ( | FXuchar * | buffer, | |
FXuval | length | |||
) | const throw () |
Calculates the tiger hash value of the specified block of data.