__arch_chach...ocks_nostack(9)
๐ __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 holdsnblocks * 64bytes 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 ๐
- Kernel file
./include/vdso/getrandom.h struct vgetrandom_state(9)__vdso_getrandom(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms