jobdesc.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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(uint32_t *desc, int handle);
  35. void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc,
  36. struct pk_in_params *pkin, uint8_t *out,
  37. uint32_t out_siz);
  38. #endif