crypto_shash_import(9)
π 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 β
0if the import was successful β we love a clean win, periodt π< 0if 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 π
Kernel file ./include/crypto/hash.h Message Digest Algorithm Definitions(9)struct ahash_alg(9)struct shash_alg(9)Asynchronous Message Digest API(9)crypto_alloc_ahash(9)crypto_free_ahash(9)crypto_has_ahash(9)crypto_ahash_blocksize(9)crypto_ahash_digestsize(9)crypto_ahash_statesize(9)crypto_ahash_reqtfm(9)crypto_ahash_reqsize(9)crypto_ahash_setkey(9)crypto_ahash_finup(9)crypto_ahash_final(9)crypto_ahash_digest(9)crypto_ahash_export(9)crypto_ahash_import(9)crypto_ahash_init(9)crypto_ahash_update(9)Asynchronous Hash Request Handle(9)ahash_request_set_tfm(9)ahash_request_alloc(9)ahash_request_free(9)ahash_request_set_callback(9)ahash_request_set_crypt(9)ahash_request_set_virt(9)Synchronous Message Digest API(9)crypto_alloc_shash(9)crypto_free_shash(9)crypto_shash_blocksize(9)crypto_shash_digestsize(9)crypto_shash_descsize(9)crypto_shash_setkey(9)crypto_shash_digest(9)crypto_shash_tfm_digest(9)crypto_shash_export(9)crypto_shash_init(9)crypto_shash_finup(9)crypto_shash_update(9)crypto_shash_final(9)
π tiny reminder thatcrypto_shash_exportis the one making the buffer andcrypto_shash_importis 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
- 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