ice.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2023, Linaro Limited
  4. */
  5. #ifndef __QCOM_ICE_H__
  6. #define __QCOM_ICE_H__
  7. #include <linux/blk-crypto.h>
  8. #include <linux/types.h>
  9. struct qcom_ice;
  10. int qcom_ice_enable(struct qcom_ice *ice);
  11. int qcom_ice_resume(struct qcom_ice *ice);
  12. int qcom_ice_suspend(struct qcom_ice *ice);
  13. int qcom_ice_program_key(struct qcom_ice *ice, unsigned int slot,
  14. const struct blk_crypto_key *blk_key);
  15. int qcom_ice_evict_key(struct qcom_ice *ice, int slot);
  16. enum blk_crypto_key_type qcom_ice_get_supported_key_type(struct qcom_ice *ice);
  17. int qcom_ice_derive_sw_secret(struct qcom_ice *ice,
  18. const u8 *eph_key, size_t eph_key_size,
  19. u8 sw_secret[BLK_CRYPTO_SW_SECRET_SIZE]);
  20. int qcom_ice_generate_key(struct qcom_ice *ice,
  21. u8 lt_key[BLK_CRYPTO_MAX_HW_WRAPPED_KEY_SIZE]);
  22. int qcom_ice_prepare_key(struct qcom_ice *ice,
  23. const u8 *lt_key, size_t lt_key_size,
  24. u8 eph_key[BLK_CRYPTO_MAX_HW_WRAPPED_KEY_SIZE]);
  25. int qcom_ice_import_key(struct qcom_ice *ice,
  26. const u8 *raw_key, size_t raw_key_size,
  27. u8 lt_key[BLK_CRYPTO_MAX_HW_WRAPPED_KEY_SIZE]);
  28. struct qcom_ice *devm_of_qcom_ice_get(struct device *dev);
  29. #endif /* __QCOM_ICE_H__ */