14 Commits

Author SHA1 Message Date
a53601ff92 HASH, IO: Rewrite module HASH.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-30 12:04:30 -03:00
9805090290 HASH: Clean up the code according to XXHASH flag.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-24 12:49:40 -03:00
a296ebc3bd HASH: Add subroutine to check hash of the input data.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-19 19:49:40 -03:00
bd5fde97f6 HASH, IO: Properly handle the digest type.
Allow to select the digest type by the user. For the restart files we
always use the XXH64 hash.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-19 10:07:46 -03:00
a10d7d5499 CMAKE, HASH, IO: Detect and use the system libxxhash.
If it is available, allow to choose between XXH64 (default) and XXH3
hash algorithms provided by the library XXHASH.

If it is not available, the internal slower implementation is used.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-18 23:15:51 -03:00
cb7a9fce7b HASH: Remove unused seed, simplify initialization of lane(1).
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-06-03 16:26:02 -03:00
3f0bd444c8 HASH: Remove the 2GiB limit for xxh64().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-02-04 17:37:53 -03:00
3d16d5c13d Update copyrights.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-02-04 17:35:04 -03:00
5c64df35e5 HASH: Remove obsolete specific xxh64_*() functions.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 17:32:04 -03:00
467609bc00 HASH: Add generic function xxh64().
This function calculates the XXH64 has using a sequence of bytes, or
integer(kind=1) vector.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 17:31:48 -03:00
3dbbd0b8b1 HASH: Change kind of local variables.
Local variables remain and offset cannot be larger than the size of
input array, so they can be 4-byte integers.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 08:32:27 -03:00
e1e025017a HASH: Rename argument data to input.
Word DATA is reserved in Fortran. Rename this argument, just to avoid
confusion.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 07:05:44 -03:00
86c7f87365 HASH: Fix hash calculation in xxh64_integer() for odd length vectors.
If the input data has an odd number of elements, the last 4-byte
element has to be padded by 4-byte structure of zeros.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 06:57:26 -03:00
cf39fa7292 HASH: Add Fortran implementation of 64-bit xxHash function.
The aim of the hash function is to verify consistency of the binary data
written in the snapshots.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-11 14:00:16 -03:00