crypto_shash_import(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– crypto_shash_import(9) β€” the Kernel API Manual, bestie edition πŸ’–

okay so you found the page for crypto_shash_import in the Kernel API Manual and honestly? it's a little one but it's iconic. it's the "put the vibes back" function. let's get into it ✨


🌸 NAME 🌸

crypto_shash_import β€” import operational state 🫢

like, you're literally bringing a saved state back into the building. no cap.


✨ SYNOPSIS ✨

int crypto_shash_import (struct shash_desc *desc , const void *in );

that's it. two args. one int coming back at you. slay. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • desc β€” reference to the operational state handle the state imported into. yes, the wording is a little twisty, but it's the handle that the state gets imported into. it's the destination, the main character receiving the glow-up πŸ’–
  • in β€” buffer holding the state. this is the little time capsule you're feeding in 🌈

πŸ¦‹ DESCRIPTION πŸ¦‹

so crypto_shash_import imports the hash state into the operational state handle, pulling it out of the input buffer. that's the whole assignment, and it ate. πŸ”₯

and here's the important part, bestie β€” that buffer should have been generated with the crypto_ahash_export function. like, the vibes have to match. you can't just hand it a random buffer and expect a slay. it's giving "the source matters", iykyk 🌸


🧚 CONTEXT 🧚

softirq or process context. that's the vibe check on where you're allowed to call it. πŸ’œ


⭐ RETURN ⭐

  • 0 if the import was successful β€” we love a clean win, periodt πŸ‘‘
  • < 0 if an error occurred β€” 😭 it happens, check your buffer

🌈 SEE ALSO 🌈

the whole friend group, fr fr. click through and say hi to all of them πŸ’…

πŸ’€ tiny reminder that crypto_shash_export is the one making the buffer and crypto_shash_import is the one reading it β€” they're a matching set, don't split them up.

k bye ily, go import some state responsibly 🫢✨

β€” this cutie lives in ./include/crypto, current as of October 2026, and it's still signed crypto_shash_import(9) πŸŽ€

πŸ“¦ where this page comes from