Skip to content

Instantly share code, notes, and snippets.

Cyber Fast Track: Redundant Array of Independent Clouds

DARPA-RA-11-52 Cyber Fast Track
  • Principal Investigators:
@zooko
zooko / testgit
Created August 7, 2012 16:39
test
test gtesttest
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);
--- 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:
### 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)

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)