rust-bitcoin-unsafe-fast/hashes/src
Martin Habovstiak fb5971cc2b Fix UB in `siphash24`
The code in `siphash24` was obtaining the pointer in buffer at offset by
accessing an element at that offset instead of accessing a range or
simply computing the offset of the pointer from the start. This is UB
because one canot access past `T` even if the allocation is known to be
large enough. This change fixes it by using a range and also replaces
complicated code with simpler use of `from_le_bytes`.

It's quite likely that this can be improved further, possibly even
removing the `unsafe` without speed penalty but it's a larger task
that's not a priority right now.
2024-09-08 12:08:13 +02:00
..
cmp.rs hashes: Introduce SPDX license identifiers 2023-05-01 09:26:36 +10:00
hash160.rs don't enable std by default when testing 2024-08-26 21:08:23 +02:00
hkdf.rs Merge rust-bitcoin/rust-bitcoin#3275: Enforce that `Hash::Bytes` is an array 2024-09-02 00:42:39 +00:00
hmac.rs Merge rust-bitcoin/rust-bitcoin#3275: Enforce that `Hash::Bytes` is an array 2024-09-02 00:42:39 +00:00
impls.rs don't enable std by default when testing 2024-08-26 21:08:23 +02:00
internal_macros.rs hashes: Use $crate in internal macros 2024-09-06 09:20:10 +10:00
lib.rs Merge rust-bitcoin/rust-bitcoin#3275: Enforce that `Hash::Bytes` is an array 2024-09-02 00:42:39 +00:00
ripemd160.rs don't enable std by default when testing 2024-08-26 21:08:23 +02:00
serde_macros.rs Change `T::from_str(s)` to `s.parse::<T>()` 2024-08-27 17:31:00 +01:00
sha1.rs don't enable std by default when testing 2024-08-26 21:08:23 +02:00
sha256.rs don't enable std by default when testing 2024-08-26 21:08:23 +02:00
sha256d.rs don't enable std by default when testing 2024-08-26 21:08:23 +02:00
sha256t.rs Deprecate `from_slice()` in sha256.rs 2024-09-06 12:33:52 +01:00
sha384.rs don't enable std by default when testing 2024-08-26 21:08:23 +02:00
sha512.rs don't enable std by default when testing 2024-08-26 21:08:23 +02:00
sha512_256.rs don't enable std by default when testing 2024-08-26 21:08:23 +02:00
siphash24.rs Fix UB in `siphash24` 2024-09-08 12:08:13 +02:00
util.rs Merge rust-bitcoin/rust-bitcoin#3275: Enforce that `Hash::Bytes` is an array 2024-09-02 00:42:39 +00:00