qcom_scm_ice_set_key(9)
๐ qcom_scm_ice_set_key ๐
Okay bestie, welcome to the qcom_scm_ice_set_key(9) page, from the Kernel API Manual โจ โ yes, section 9, the cool kernel-functions section, we love that for us.
๐ธ NAME ๐ธ
qcom_scm_ice_set_key โ set an inline encryption key ๐
๐ SYNOPSIS ๐
int qcom_scm_ice_set_key (u32 index , const u8 *key , u32 key_size ,
enum qcom_scm_ice_cipher cipher , u32 data_unit_size );
๐ฆ ARGUMENTS ๐ฆ
indexโ the keyslot into which to set the key. like, which lil drawer the key goes in ๐๏ธkeyโ the key to program. the actual secret-sauce bytes โจkey_sizeโ the size of the key in bytes, ngl you gotta know your own key's measurements ๐cipherโ the encryption algorithm the key is for. which vibe of crypto we're doing ๐data_unit_sizeโ the encryption data unit size, i.e. the size of each individual plaintext and ciphertext. Given in 512-byte units, e.g. 1 = 512 bytes, 8 = 4096 bytes, etc. so like, it's counted in chonky 512-byte lil units, not raw bytes, ok bestie? ๐งฎ
โญ DESCRIPTION โญ
So here's the tea โ โ this function programs a key into a keyslot of Qualcomm ICE (Inline Crypto Engine), where it can then be used to encrypt/decrypt UFS or eMMC I/O requests inline. literally doing encryption as the I/O flies by, main character energy ๐ ๐ฅ
Now, the UFSHCI and eMMC standards define a standard way to do this, but it doesn't work on these SoCs; only this SCM call does. yep. the standard way simply does not slay here ๐ only this SCM call gets the job done, periodt.
and one important thing, bestie: it is assumed that the SoC has only one ICE instance being used, as this SCM call doesn't specify which ICE instance the keyslot belongs to. so like, don't come for me if you've got multiple โ the function genuinely can't tell which one you mean ๐ญ
๐ซถ RETURN ๐ซถ
0 on success; -errno on failure. zero means we ate and left no crumbs, negative errno means something went sideways ๐
๐ SEE ALSO ๐
Kernel file ./drivers/firmware/qcom/qcom_scm.c struct qcom_scm_qseecom_resp(9), qcom_scm_call(9), qcom_scm_call_atomic(9), qcom_scm_set_warm_boot_addr(9), qcom_scm_set_cold_boot_addr(9), qcom_scm_cpu_power_down(9), qcom_scm_is_pas_available(9), qcom_scm_restore_sec_cfg_available(9), qcom_scm_assign_mem(9), qcom_scm_ocmem_lock_available(9), qcom_scm_ocmem_lock(9), qcom_scm_ocmem_unlock(9), qcom_scm_ice_available(9), qcom_scm_ice_invalidate_key(9), qcom_scm_derive_sw_secret(9), qcom_scm_generate_ice_key(9), qcom_scm_prepare_ice_key(9), qcom_scm_import_ice_key(9), qcom_scm_hdcp_available(9), qcom_scm_hdcp_req(9), qcom_scm_qseecom_call(9), qcom_scm_qseecom_get_version(9), qcom_scm_qseecom_app_get_id(9), qcom_scm_qseecom_app_send(9), qcom_scm_qtee_invoke_smc(9), qcom_scm_qtee_callback_response(9), qcom_scm_is_available(9)
the whole friend group, fr fr ๐ฏโโ๏ธ go say hi.
okay that's the whole page, bestie, you're so welcome ๐ this drop came from ./drivers/firmware/qcom, dated October 2026 โ so like, future iconic behavior, iykyk ๐งโจ mwah, go set some keys ๐
๐ฆ 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