jobdesc.h 1.4 KB

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