Commit graph

16 commits

Author SHA1 Message Date
Ashish Kumar
53e8999271
implement shake-128 and shake-256 (#6490) 2026-06-23 11:47:13 +08:00
NOT XVilka
9632328f74
Add χ² , index of coincidence, min-entropy, serial correlation statistical indicators (#6466)
* hash: add chi-square (vs uniform) rz-hash plugin

Adds a chi-square goodness-of-fit (vs a uniform byte distribution)
statistic as an rz-hash plugin and the rz_hash_chisquare() API.

Unlike Shannon entropy, chi-square separates high-entropy data that is
truly uniform (encryption/CSPRNG, ~255) from high-entropy data that is
merely compressed or packed (much larger values), which is a common
question when triaging firmware blobs.

* hash: add index-of-coincidence rz-hash plugin

Adds the index of coincidence as an rz-hash plugin and the
rz_hash_ioc() API. IoC is ~1/256 for uniform data and markedly higher
for text, padding, single-byte-XOR'd data and repeating-key regions;
computed at several strides it is the Friedman/Kasiski test for a
repeating-XOR period.

* hash: add min-entropy rz-hash plugin

Adds min-entropy H_inf = -log2(max_i p_i) as an rz-hash plugin and the
rz_hash_min_entropy() API. This is the conservative worst-case entropy
used by NIST SP 800-90B: 8.0 for a uniform block, dropping as soon as a
single byte value dominates.

* hash: add serial-correlation rz-hash plugin

Adds the lag-1 serial correlation coefficient (with wrap-around, as in
the classic `ent` tool) as an rz-hash plugin and the
rz_hash_serial_correlation() API. Near 0 for compressed/encrypted data
but clearly non-zero for executable code, counters and gradients - the
order-aware axis that the histogram-only metrics cannot see.

---------

Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2026-06-08 00:20:15 +08:00
Cheese Cake
85cbb92b22
hash: add fnv1a algorithm (#6186) 2026-04-09 19:05:02 +08:00
Shessaanand Siva Sivamurugan
7ad49c41c2
hash: add jenkins non-cryptographic hash (#6121) 2026-04-02 01:42:23 +08:00
cheese-cakee
ca2fd3b954
hash: add xxhash64 algorithm (#6098) 2026-03-28 05:16:44 +08:00
Ashish Kumar
f6344debf8
librz/hash: add murmur3 hash function (without keys support) (#6002) 2026-03-25 15:46:37 +08:00
Farhan Saiyed
e4464a1c55
blake2 hash support (#5995) 2026-03-06 22:17:59 +08:00
Ashish Kumar
732a5d6185
librz/hash: Add sha3 (incl. keccak) support (#5886) 2026-02-28 20:16:13 +08:00
Seva D.
915d03e307
Add calculation of total information content and information temperature (#5167) 2025-05-30 00:30:24 +08:00
Giovanni
305a2cb3ae
Add SM3 hash (#3769) 2023-08-17 21:59:06 +08:00
swedenspy
655ea987cc
MD2 - hash implementation added according to RFC 1319 (#3585) 2023-06-18 23:01:57 +08:00
Riccardo Schirone
2987e035da hash: use RzHash in most hash APIs 2022-06-28 21:55:26 +08:00
Riccardo Schirone
9ea7c2fa5a RzHash: rename everything in librz/hash to RzHash prefix 2022-06-28 21:55:26 +08:00
Giovanni
d2fac299ed
Added details on pointer ownership (#1164) 2021-05-24 20:17:21 +02:00
Giovanni
cf56e35614
Fix Coverity issues (#1104) 2021-05-06 00:02:04 +08:00
Giovanni
82e7917294
Refactoring Hash (#1082)
* Added authors and licenses and plugin access to crypto related files
* removed `rz_hash` and related files
* introduced `rz_msg_digest_*` with plugins
* updated all old methods with newer ones.
* added HMAC support to `rz-hash` (moved key option under `-K`)
* removed wrong algorithms on `woD`/`woE`
* fixed parity digest size
* fixed the behaviour on all hash functions
* added unit test for hash
* optimized code for HMAC key calculation
* removed hash legacy tests
2021-05-02 20:47:17 +08:00