__arch_chach...ocks_nostack(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… __arch_chach...ocks_nostack(9) โ€” like, the whole vibe

okay so bestie, welcome to the Kernel API Manual, section 9 ๐ŸŽ€ โ€” this is the page for __arch_chacha20_blocks_nostack, and yes the title is literally truncated with ... in it, that's not me being lazy, that's just how the page header ships. iconic behavior honestly.


โœจ NAME โœจ

__arch_chacha20_blocks_nostack โ€” generate ChaCha20 stream without using the stack. no stack, no problem, we simply do not vibe with the stack today ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

void __arch_chacha20_blocks_nostack (u8 *dst_bytes , const u32 *key ,
u32 *counter , size_t nblocks );

that's the whole signature, spaces and all, don't @ me โ€” copy it exactly ๐Ÿซถ


๐Ÿฆ‹ ARGUMENTS ๐Ÿฆ‹

okay so here's who's who in this function's group chat:

  • dst_bytes โ€” the destination buffer ๐ŸŽฏ it's where the output goes, and it holds nblocks * 64 bytes of output. so yeah, you need that much room. plan accordingly bestie.
  • key โ€” a 32-byte input key ๐Ÿ”‘ thirty-two. not 16, not 31. 32.
  • counter โ€” an 8-byte counter ๐Ÿงฎ it gets read on input and updated on return. so it goes in with a value and comes out changed โ€” main character energy, it's literally not the same counter you sent in.
  • nblocks โ€” the number of blocks to generate ๐Ÿ”ข that's it, that's the job.

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

so what does it actually do? it generates a given positive number of blocks of ChaCha20 output, with nonce=0 ๐Ÿ‘€ โ€” and here's the part that ate: it does not write to any stack or memory outside of the parameters passed to it.

why are we like this? because the whole point is to mitigate stack data leaking into forked child processes ๐Ÿ˜ญ like, imagine your leftover stack bytes just... showing up in your child process. no. not on our watch. we keep it contained, we keep it clean, we write only to what we were handed. slay ๐Ÿงš

ngl this is one of those functions where the constraint is the feature โ€” "nostack" is right there in the name, it's giving exactly what it says on the tin ๐Ÿ”ฅ

โญ SEE ALSO โญ

go read these next, iykyk ๐Ÿ‘‘


and that's the page!! ๐ŸŒˆ this little number lives in ./include/vdso and it's dated October 2026 โ€” so like, future vibes only โฐ๐Ÿ’– anyway go forth and generate your blocks, bestie, and remember: no stack, no leaks, no notes ๐Ÿ‘‘โœจ

๐Ÿ“ฆ where this page comes from