The difference between the first two is that, according to the RHash
source code, BTIH
hashes requires additional data to be correctly computed.
The init_btih_data
function in calc_sums.c
is documented with:
Initialize BTIH hash function. Unlike other algorithms BTIH requires more data for correct computation.
In test_hashes.c
, the BTIH
examples are actually treated differently depending on whether USE_BTIH_WITH_TEST_FILENAME
has been defined.
That init_btih_data
function (which only seems to get called when running the command line application) in turn calls the rhash_trasmit
function a number of times depending on various parameters. At a minimum, it will call it twice, which probably explains the difference between the first two. It can, however, call it a number of other times, which I think explains the difference we see with uTorrent.
The difficulty is that while the unmanaged DLL exposes the rhash_trasmit
function, the .NET bindings do not, which means that it is not possible to supply the additional data that is expected.