ssi_pal_fips.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /**************************************************************************************
  2. * Copyright (c) 2016-2017, ARM Limited or its affiliates. All rights reserved *
  3. * *
  4. * This file and the related binary are licensed under the following license: *
  5. * *
  6. * ARM Object Code and Header Files License, v1.0 Redistribution. *
  7. * *
  8. * Redistribution and use of object code, header files, and documentation, without *
  9. * modification, are permitted provided that the following conditions are met: *
  10. * *
  11. * 1) Redistributions must reproduce the above copyright notice and the *
  12. * following disclaimer in the documentation and/or other materials *
  13. * provided with the distribution. *
  14. * *
  15. * 2) Unless to the extent explicitly permitted by law, no reverse *
  16. * engineering, decompilation, or disassembly of is permitted. *
  17. * *
  18. * 3) Redistribution and use is permitted solely for the purpose of *
  19. * developing or executing applications that are targeted for use *
  20. * on an ARM-based product. *
  21. * *
  22. * DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
  23. * CONTRIBUTORS "AS IS." ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT *
  24. * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, *
  25. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
  26. * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
  27. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED *
  28. * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
  29. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
  30. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
  31. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
  33. **************************************************************************************/
  34. #ifndef _SSI_PAL_FIPS_H
  35. #define _SSI_PAL_FIPS_H
  36. /*!
  37. @file
  38. @brief This file contains definitions that are used by the FIPS related APIs. The implementation of these functions
  39. need to be replaced according to Platform and OS.
  40. */
  41. #include "ssi_pal_types_plat.h"
  42. #include "crys_fips.h"
  43. #include "crys_fips_defs.h"
  44. /**
  45. * @brief This function purpose is to get the FIPS state.
  46. *
  47. *
  48. * @return Zero on success.
  49. * @return A non-zero value on failure.
  50. */
  51. SaSiError_t SaSi_PalFipsGetState(CC_FipsState_t *pFipsState);
  52. /**
  53. * @brief This function purpose is to get the FIPS Error.
  54. *
  55. *
  56. * @return Zero on success.
  57. * @return A non-zero value on failure.
  58. */
  59. SaSiError_t SaSi_PalFipsGetError(CC_FipsError_t *pFipsError);
  60. /**
  61. * @brief This function purpose is to get the FIPS trace.
  62. *
  63. *
  64. * @return Zero on success.
  65. * @return A non-zero value on failure.
  66. */
  67. SaSiError_t SaSi_PalFipsGetTrace(CC_FipsTrace_t *pFipsTrace);
  68. /**
  69. * @brief This function purpose is to set the FIPS state.
  70. *
  71. *
  72. * @return Zero on success.
  73. * @return A non-zero value on failure.
  74. */
  75. SaSiError_t SaSi_PalFipsSetState(CC_FipsState_t fipsState);
  76. /**
  77. * @brief This function purpose is to set the FIPS error.
  78. *
  79. *
  80. * @return Zero on success.
  81. * @return A non-zero value on failure.
  82. */
  83. SaSiError_t SaSi_PalFipsSetError(CC_FipsError_t fipsError);
  84. /**
  85. * @brief This function purpose is to set the FIPS trace.
  86. *
  87. *
  88. * @return Zero on success.
  89. * @return A non-zero value on failure.
  90. */
  91. SaSiError_t SaSi_PalFipsSetTrace(CC_FipsTrace_t fipsTrace);
  92. /**
  93. * @brief This function should push the FIPS TEE library error towards the REE library,
  94. * the FIPS error can occur while running KAT tests at library init or while running
  95. * conditional or continues tests
  96. *
  97. * @return Zero on success.
  98. * @return A non-zero value on failure.
  99. */
  100. SaSiError_t SaSi_PalFipsNotifyUponTeeError(void);
  101. #endif // _SSI_PAL_FIPS_H