ocs_hcu_hmac(9)
π ocs_hcu_hmac β Kernel API Manual β¨
okay so bestie, welcome to the Kernel API Manual entry for ocs_hcu_hmac(9) β literally the function whose whole entire job is computing an HMAC. that's it. that's the vibe. no cap. π
πΈ NAME πΈ
ocs_hcu_hmac β compute HMAC. yes ghoul, it does exactly what the name says, main character energy from the very first line π
β¨ SYNOPSIS β¨
int ocs_hcu_hmac (struct ocs_hcu_dev *hcu_dev , enum ocs_hcu_algo algo ,
const u8 *key , size_t key_len , const struct ocs_hcu_dma_list *dma_list
, u8 *dgst , size_t dgst_len );
look at that signature. it's giving seven-whole-parameters. she's thorough, she's precise, she does not skip a single argument π₯
π¦ ARGUMENTS π¦
okay so let's go through every single one of these, because nobody's getting left out on my watch π«Ά
hcu_devβ the OCS HCU device to use. this is your hardware bestie, the one actually doing the work πͺalgoβ the hash algorithm to use with HMAC. it's anenum ocs_hcu_algo, so pick your fave, but like... actually pick the right one πkeyβ the key to use. the secret ingredient. the whole personality of the HMAC tbh πkey_lenβ the length ofkey. it's asize_t, and yes you do have to get it right βdma_listβ the OCS DMA list mapping the input data to process. it's aconst struct ocs_hcu_dma_list *, so the data's already mapped and ready to slay πdgstβ the buffer where to save the computed HMAC. this is where the finished product lands, so make sure it's got room πdgst_lenβ the length ofdgst. again with thesize_t. again: get it right, bestie π
π RETURN π
0on success- negative error code otherwise
that's literally it. zero is the slay outcome, anything negative means something went sideways and you should probably look into it π
π§ SEE ALSO π§
the kernel file for all of this lives at ./drivers/crypto/intel/keembay/ocs-hcu.c β highly recommend a lil scroll if ur nosy like me π
and the whole friend group, in order:
struct ocs_hcu_dma_entry(9)struct ocs_hcu_dma_list(9)ocs_hcu_wait_busy(9)ocs_hcu_get_intermediate_data(9)ocs_hcu_set_intermediate_data(9)ocs_hcu_hw_cfg(9)ocs_hcu_clear_key(9)ocs_hcu_write_key(9)ocs_hcu_ll_dma_start(9)ocs_hcu_hash_init(9)ocs_hcu_hash_update(9)ocs_hcu_hash_finup(9)ocs_hcu_hash_final(9)ocs_hcu_digest(9)
iykyk, that's the whole squad π
real talk though: this page is from the./drivers/crypto/intel/keembaydirectory, dated October 2026, and the page itself isocs_hcu_hmac(9). so like, cite me properly if you're quoting me in ur writeup bestie π
mwah, go forth and compute those HMACs 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