ethosn_cert.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2023, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef ETHOSN_CERT_H
  7. #define ETHOSN_CERT_H
  8. #include "ethosn_oid.h"
  9. #include <tbbr/tbb_ext.h>
  10. #include <tbbr/tbb_key.h>
  11. /* Arm(R) Ethos(TM)-N NPU Certificates */
  12. #define ETHOSN_NPU_FW_KEY_CERT_DEF { \
  13. .id = ETHOSN_NPU_FW_KEY_CERT, \
  14. .opt = "npu-fw-key-cert", \
  15. .help_msg = "Arm(R) Ethos(TM)-N NPU Firmware Key Certificate (output file)", \
  16. .fn = NULL, \
  17. .cn = "NPU Firmware Key Certificate", \
  18. .key = NON_TRUSTED_WORLD_KEY, \
  19. .issuer = ETHOSN_NPU_FW_KEY_CERT, \
  20. .ext = { \
  21. NON_TRUSTED_FW_NVCOUNTER_EXT, \
  22. ETHOSN_NPU_FW_CONTENT_CERT_PK_EXT, \
  23. }, \
  24. .num_ext = 2 \
  25. }
  26. #define ETHOSN_NPU_FW_CONTENT_CERT_DEF { \
  27. .id = ETHOSN_NPU_FW_CONTENT_CERT, \
  28. .opt = "npu-fw-cert", \
  29. .help_msg = "Arm(R) Ethos(TM)-N NPU Firmware Content Certificate (output file)",\
  30. .fn = NULL, \
  31. .cn = "NPU Firmware Content Certificate", \
  32. .key = ETHOSN_NPU_FW_CONTENT_CERT_KEY, \
  33. .issuer = ETHOSN_NPU_FW_CONTENT_CERT, \
  34. .ext = { \
  35. NON_TRUSTED_FW_NVCOUNTER_EXT, \
  36. ETHOSN_NPU_FW_HASH_EXT, \
  37. }, \
  38. .num_ext = 2 \
  39. }
  40. /* NPU Extensions */
  41. #define ETHOSN_NPU_FW_CONTENT_CERT_PK_EXT_DEF { \
  42. .oid = ETHOSN_NPU_FW_CONTENT_CERT_PK_OID, \
  43. .help_msg = "Arm(R) Ethos(TM)-N NPU Firmware content certificate public key", \
  44. .sn = "NPUFirmwareContentCertPK", \
  45. .ln = "NPU Firmware content cerificate public key", \
  46. .asn1_type = V_ASN1_OCTET_STRING, \
  47. .type = EXT_TYPE_PKEY, \
  48. .attr.key = ETHOSN_NPU_FW_CONTENT_CERT_KEY \
  49. }
  50. #define ETHOSN_NPU_FW_HASH_EXT_DEF { \
  51. .oid = ETHOSN_NPU_FW_BINARY_OID, \
  52. .opt = "npu-fw", \
  53. .help_msg = "Arm(R) Ethos(TM)-N NPU Firmware image file (input file)", \
  54. .sn = "NPUFirmwareHash", \
  55. .ln = "NPU Firmware Hash (SHA256)", \
  56. .asn1_type = V_ASN1_OCTET_STRING, \
  57. .type = EXT_TYPE_HASH \
  58. }
  59. /* NPU Keys */
  60. #define ETHOSN_NPU_FW_CONTENT_CERT_KEY_DEF { \
  61. .id = ETHOSN_NPU_FW_CONTENT_CERT_KEY, \
  62. .opt = "npu-fw-key", \
  63. .help_msg = "Arm(R) Ethos(TM)-N NPU Firmware Content Certificate key (input/output file)",\
  64. .desc = "NPU Firmware Content Certificate key" \
  65. }
  66. #endif /* ETHOSN_CERT_H */