terminal/snapshot: remove BLAKE3 digests

Remove BLAKE3 prefix digests. Keep READY/FINISH as empty records since
they're semantically important markers.

Our existing format (CRC32 per-record, declared counts, strict tag ordering
requirements, etc.) already detect: accidental corruption, truncation,
data omission, and duplication. 

BLAKE3 only protects against valid records being swapped or removed entirely. 
It is heavy for just that, and callers can solve that anyways via their
own transport (like, just use TCP). For more adversarial protection,
callers can also add layers like TLS or their own alternate signing
methods depending on their own threat models.

Removing the hash improves encode times by ~1.4x, decode times by ~1.3x.
Time-to-READY decoding is effectively unchanged because it was such a 
small package to begin with.
This commit is contained in:
Mitchell Hashimoto
2026-08-06 13:50:06 -07:00
parent 22d13172cd
commit 219173ab37
14 changed files with 168 additions and 388 deletions

View File

@@ -104,7 +104,7 @@ int main(void) {
NULL, &incremental_decoder, reader);
assert(result == GHOSTTY_SUCCESS);
// READY authenticates and returns a renderable terminal before old history.
// READY returns a validated, renderable terminal before old history.
GhosttyTerminal incremental_terminal = NULL;
result = ghostty_snapshot_decoder_ready(
incremental_decoder, &incremental_terminal);
@@ -146,7 +146,7 @@ int main(void) {
page_count++;
}
// NO_VALUE means FINISH authenticated successfully and is idempotent.
// NO_VALUE means FINISH validated successfully and is idempotent.
assert(result == GHOSTTY_NO_VALUE);
assert(page_count > 0);
assert(ghostty_snapshot_decoder_next(incremental_decoder) ==