sha256_finup_2x(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sha256_finup_2x(9) β€” like, the Kernel API Manual page you actually want to read ✨

okay so picture this: you're gonna hash two things at once, and this function is the moment. 🫢


✨ NAME ✨

sha256_finup_2x β€” compute two SHA-256 digests from a common initial context. On some CPUs, this is faster than sequentially computing each digest. no cap, that's literally the whole pitch πŸ’«


πŸŽ€ SYNOPSIS πŸŽ€

void sha256_finup_2x (const struct sha256_ctx *ctx , const u8 *data1 ,
const u8 *data2 , size_t len , u8 out1[static SHA256_DIGEST_SIZE] , u8
out2[static SHA256_DIGEST_SIZE] );

🌸 ARGUMENTS 🌸

  • ctx β€” an optional initial context, which may have already processed data. If NULL, a default initial context is used (equivalent to sha256_init). so yes bestie, optional, it's giving "bring your own state or don't, we got you" πŸ’–
  • data1 β€” data for the first message
  • data2 β€” data for the second message
  • len β€” the length of each of data1 and data2, in bytes (that's each, not total, don't come for me πŸ™ˆ)
  • out1 β€” (output) the first SHA-256 message digest
  • out2 β€” (output) the second SHA-256 message digest

πŸ¦‹ CONTEXT πŸ¦‹

Any context. that's the whole section. iconic, honestly πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, fr fr β€” starting with the kernel file ./include/crypto/sha2.h:


reminder bestie: len is the length of each buffer, and both out1 and out2 are SHA256_DIGEST_SIZE bytes. write outside that and it's not a slay, it's a buffer overflow πŸ’€

kisses from the ./include/crypto directory, October 2026 edition πŸ’œβœ¨ mwah, go hash something twice as fast πŸŽ€

πŸ“¦ where this page comes from