| Hash | GF(2), cost/byte | Prime field, cost/byte |
|---|---|---|
| BLAKE3 | 322 | 235–400 |
| SHA-256 | 694 | 290–490 |
| SHA3-256 | 1,095–1,260 | 2,880 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Small message (64 bytes, one compression of each) | |
| | Hash | GF(2), cost/byte | Prime field, cost/byte | | |
| |---|---|---| | |
| | BLAKE3 | **322** | 235–400 | | |
| | SHA-256 | **694** | 290–490 | | |
| | SHA3-256 | 1,095–1,260 | **2,880** | | |
| ### Long message (asymptotic) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- log of AI interactions: | |
| ---- GPT 5.4: | |
| prompt: | |
| I'm writing a memory allocator. It is already extremely simple — far simpler than comparable memory allocators like mimalloc, snmalloc, or rpmalloc — and extremely fast. Now I'm thinking about "hardening" against exploitation. Hardening against exploitation is a complicated topic, and I find it difficult to assess which kinds of hardening actually provide the most "bang for the buck" in terms of stopping attacks effectively while adding a minimal cost in terms of complexity and runtime. How would you go about determining what "hardening" features provide the most real-world protection? | |
| Here's the current source code: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::time::Instant; | |
| use std::time::Duration; | |
| fn meas(n: usize, f: fn(n: usize, iters: usize, inpv: Vec<Vec<u8>>, outpv: &mut Vec<Vec<u8>>, measures: &mut Vec<Duration>)->(), setup_for_f: fn(n: usize, iters: usize, inpv: &mut Vec<Vec<u8>>, outpv: &mut Vec<Vec<u8>>)->()) { | |
| let iters : usize = 800; | |
| let mut inpv : Vec<Vec<u8>> = Vec::with_capacity(iters); | |
| let mut outpv : Vec<Vec<u8>> = Vec::with_capacity(iters); | |
| let mut measures : Vec<Duration> = Vec::with_capacity(iters); | |
| setup_for_f(n, iters, &mut inpv, &mut outpv); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test gtesttest |