Back to Index

The MaybeBoost Hash Library: Validation

Test Vectors

The tests include all the test vectors available in the standards, as well as others verified against reference or other well-known implementations.

For MD4 and MD5, these are the test vectors from the RFCs. For SHA-1 and the SHA-2 family, they come from the FIPS standard and the SHAVS examples. SHA is checked against a published collision. CubeHash is tested against answers obtained from the NIST-submitted "reference" implementation.

See libs/hash/test/ for full details.

Speed vs Code Clarity

All implementations were initially written to follow the specs very closely to simplify manual verification by code inspection. These implementations, however, are usually a few hundred percent slower than optimized implementations, and occasionally much worse than that.

In various places, optimizations have been applied, and these are used by default. The original implementations are still accessible, however, by defining BOOST_HASH_NO_OPTIMIZATION. This is useful for checking the correctness of the optimizations.

Previous: Performance Next: Rationale

Copyright Scott McMurray 2010

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at