sha256_finup_2x(9)
π 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. IfNULL, a default initial context is used (equivalent tosha256_init). so yes bestie, optional, it's giving "bring your own state or don't, we got you" πdata1β data for the first messagedata2β data for the second messagelenβ the length of each ofdata1anddata2, in bytes (that's each, not total, don't come for me π)out1β (output) the first SHA-256 message digestout2β (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:
- the sha224 girlies:
struct sha224_ctx(9),sha224_init(9),sha224_update(9),sha224_final(9),sha224(9) - the hmac_sha224 girlies:
struct hmac_sha224_key(9),struct hmac_sha224_ctx(9),hmac_sha224_preparekey(9),hmac_sha224_init(9),hmac_sha224_init_usingrawkey(9),hmac_sha224_update(9),hmac_sha224_final(9),hmac_sha224(9),hmac_sha224_usingrawkey(9) - the sha256 girlies:
struct sha256_ctx(9),sha256_init(9),sha256_update(9),sha256_final(9),sha256(9),sha256_finup_2x_is_optimized(9)β that last one is the vibe check, check it before you assume anything is optimized π - the hmac_sha256 girlies:
struct hmac_sha256_key(9),struct hmac_sha256_ctx(9),hmac_sha256_preparekey(9),hmac_sha256_init(9),hmac_sha256_init_usingrawkey(9),hmac_sha256_update(9),hmac_sha256_final(9),hmac_sha256(9),hmac_sha256_usingrawkey(9) - the sha384 girlies:
struct sha384_ctx(9),sha384_init(9),sha384_update(9),sha384_final(9),sha384(9) - the hmac_sha384 girlies:
struct hmac_sha384_key(9),struct hmac_sha384_ctx(9),hmac_sha384_preparekey(9),hmac_sha384_init(9),hmac_sha384_init_usingrawkey(9),hmac_sha384_update(9),hmac_sha384_final(9),hmac_sha384(9),hmac_sha384_usingrawkey(9) - the sha512 girlies:
struct sha512_ctx(9),sha512_init(9),sha512_update(9),sha512_final(9),sha512(9) - the hmac_sha512 girlies:
struct hmac_sha512_key(9),struct hmac_sha512_ctx(9),hmac_sha512_preparekey(9),hmac_sha512_init(9),hmac_sha512_init_usingrawkey(9),hmac_sha512_update(9),hmac_sha512_final(9),hmac_sha512(9),hmac_sha512_usingrawkey(9)
reminder bestie:lenis the length of each buffer, and bothout1andout2areSHA256_DIGEST_SIZEbytes. 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
- 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