jobdesc.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2014 Freescale Semiconductor, Inc.
  4. *
  5. */
  6. #ifndef __JOBDESC_H
  7. #define __JOBDESC_H
  8. #include <common.h>
  9. #include <asm/io.h>
  10. #include "rsa_caam.h"
  11. #define KEY_IDNFR_SZ_BYTES 16
  12. #ifdef CONFIG_CMD_DEKBLOB
  13. /* inline_cnstr_jobdesc_blob_dek:
  14. * Intializes and constructs the job descriptor for DEK encapsulation
  15. * using the given parameters.
  16. * @desc: reference to the job descriptor
  17. * @plain_txt: reference to the DEK
  18. * @enc_blob: reference where to store the blob
  19. * @in_sz: size in bytes of the DEK
  20. * @return: 0 on success, ECONSTRJDESC otherwise
  21. */
  22. int inline_cnstr_jobdesc_blob_dek(uint32_t *desc, const uint8_t *plain_txt,
  23. uint8_t *enc_blob, uint32_t in_sz);
  24. #endif
  25. void inline_cnstr_jobdesc_hash(uint32_t *desc,
  26. const uint8_t *msg, uint32_t msgsz, uint8_t *digest,
  27. u32 alg_type, uint32_t alg_size, int sg_tbl);
  28. void inline_cnstr_jobdesc_blob_encap(uint32_t *desc, uint8_t *key_idnfr,
  29. uint8_t *plain_txt, uint8_t *enc_blob,
  30. uint32_t in_sz);
  31. void inline_cnstr_jobdesc_blob_decap(uint32_t *desc, uint8_t *key_idnfr,
  32. uint8_t *enc_blob, uint8_t *plain_txt,
  33. uint32_t out_sz);
  34. void inline_cnstr_jobdesc_rng_instantiation(u32 *desc, int handle, int do_sk);
  35. void inline_cnstr_jobdesc_rng_deinstantiation(u32 *desc, int handle);
  36. void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc,
  37. struct pk_in_params *pkin, uint8_t *out,
  38. uint32_t out_siz);
  39. #endif