| 1 |
package wasi:[email protected]; |
| 2 |
/// The insecure-seed interface for seeding hash-map DoS resistance. |
| 3 |
/// |
| 4 |
/// It is intended to be portable at least between Unix-family platforms and |
| 5 |
/// Windows. |
| 6 |
interface insecure-seed { |
| 7 |
/// Return a 128-bit value that may contain a pseudo-random value. |
| 8 |
/// |
| 9 |
/// The returned value is not required to be computed from a CSPRNG, and may |
| 10 |
/// even be entirely deterministic. Host implementations are encouraged to |
| 11 |
/// provide pseudo-random values to any program exposed to |
| 12 |
/// attacker-controlled content, to enable DoS protection built into many |
| 13 |
/// languages' hash-map implementations. |
| 14 |
/// |
| 15 |
/// This function is intended to only be called once, by a source language |
| 16 |
/// to initialize Denial Of Service (DoS) protection in its hash-map |
| 17 |
/// implementation. |
| 18 |
/// |
| 19 |
/// # Expected future evolution |
| 20 |
/// |
| 21 |
/// This will likely be changed to a value import, to prevent it from being |
| 22 |
/// called multiple times and potentially used for purposes other than DoS |
| 23 |
/// protection. |
| 24 |
insecure-seed: func() -> tuple<u64, u64>; |
| 25 |
} |