qcom_scm_ice_set_key(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’– 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