You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return value ^ secrets[0]; // Both secrets and values are already 24-bit.
232
232
}
@@ -350,7 +350,7 @@ This family of xorshift-multiply constructions is used in many pseudorandom numb
350
350
351
351
Since our multipliers are random secrets, the interaction between the two operations differs for each set of secrets, and multiple rounds of alternation helps spread the uncertainty across all bits. Applying this structure to our 24-bit input space, we first came up with the following design:
To recover the original value, we can simply apply the steps in reverse order, replacing each multiplier with its modular inverse. This looks nicely symmetric:
368
368
369
-
```c++
369
+
```cpp
370
370
// Modular inverses in m_inv[] are precomputed using Newton's method at startup.
@@ -487,7 +487,7 @@ We [ran the same analysis on multipliers derived from 50 sets of randomly genera
487
487
488
488
We went with 2 rounds initially because that is the minimum to ensure every input bit reaches every output bit through at least one multiplication, providing nonlinear mixing rather than a single XOR fold. The fluctuations across the test runs, however, seemed to warrant another round, so we tested a 3-round version that looks like this:
// Multipliers in m[] are odd and randomly generated at startup.
@@ -621,7 +621,7 @@ To quantify the performance impact of the changes, we ran four JavaScript benchm
621
621
622
622
## Deployment
623
623
624
-
The new seeded hashing scheme for array index strings has been merged into V8, gated by [`v8_enable_seeded_array_index_hash = true`](https://chromium.googlesource.com/v8/v8/+/d3f0ec122bd234aa82347cc0e838c8fae8cd6565/BUILD.gn#510), and it needs to be used together with [`v8_use_default_hasher_secret = false`](https://chromium.googlesource.com/v8/v8/+/d3f0ec122bd234aa82347cc0e838c8fae8cd6565/BUILD.gn#507) for HashDoS resistance. For Chrome, where DoS attacks are not applicable, this will be disabled. In Node.js, this is enabled and shipped to v25, v24, v22, and v20 in the [March 2026 security release](/blog/vulnerability/march-2026-security-releases)
624
+
The new seeded hashing scheme for array index strings has been merged into V8, gated by [`v8_enable_seeded_array_index_hash = true`](https://chromium.googlesource.com/v8/v8/+/d3f0ec122bd234aa82347cc0e838c8fae8cd6565/BUILD.gn#510), and it needs to be used together with [`v8_use_default_hasher_secret = false`](https://chromium.googlesource.com/v8/v8/+/d3f0ec122bd234aa82347cc0e838c8fae8cd6565/BUILD.gn#507) for HashDoS resistance. For Chrome, where DoS attacks are not applicable, this will be disabled. In Node.js, this is enabled and shipped to v25, v24, v22, and v20 in the [March 2026 security release](/blog/vulnerability/march-2026-security-releases).
625
625
626
626
We have also notified other V8 embedders (Deno and Cloudflare workers) about the vulnerability and the fix during the development and the rollout.
0 commit comments