ahash_request_set_callback(9)
π ahash_request_set_callback β¨
okay so bestie, we're in the Kernel API Manual today and the star of the show is ahash_request_set_callback β the little function that decides who gets called when your async hash finishes doing its thing. literally the "text me when you're done" of the crypto API π«Ά
π NAME π
ahash_request_set_callback β set asynchronous callback function π
β¨ SYNOPSIS β¨
void ahash_request_set_callback (struct ahash_request *req , u32 flags ,
crypto_completion_t compl , void *data );
πΈ ARGUMENTS πΈ
reqβ the request handle. your main character. the thing the callback gets registered on πflagsβ specify zero or an ORing of the flags π so like, either zero, or you OR these bad boys together:CRYPTO_TFM_REQ_MAY_BACKLOGβ the request queue may back log and increase the wait queue beyond the initial maximum sizeCRYPTO_TFM_REQ_MAY_SLEEPβ the request processing may sleep π΄
complβ callback function pointer to be registered with the request handle. this is the "you up?" function πdataβ The data pointer refers to memory that is not used by the kernel crypto API, but provided to the callback function for it to use. Here, the caller can provide a reference to memory the callback function can operate on. As the callback function is invoked asynchronously to the related functionality, it may need to access data structures of the related functionality which can be referenced using this pointer. The callback function can access the memory via the"data"field in thecrypto_async_requestdata structure provided to the callback function. π§ basically it's your lil bag of stuff that the kernel is like "not mine, not touching it, but here, your callback can have it" no cap
π¦ DESCRIPTION π¦
This function allows setting the callback function that is triggered once the cipher operation completes. β
The callback function is registered with the ahash_request handle and must comply with the following template β like, this is the vibe check it has to pass, fr fr:
void callback_function(struct crypto_async_request *req, int error)
bestie please do not freestyle the signature. it must comply. the kernel is not flexible about this one π
π SEE ALSO π
- 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_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_import(9)
- crypto_shash_init(9)
- crypto_shash_finup(9)
- crypto_shash_update(9)
- crypto_shash_final(9)
and that's the whole page, bestie, you ate that π β¨
this lil gem lives over in ./include/crypto, dated October 2026, and it's filed under ahash_request_set_callback(9) β go forth and register those callbacks responsibly ππ¦π
π¦ 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