esp_crypto_lock.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #pragma once
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /**
  18. * @brief Acquire lock for HMAC cryptography peripheral
  19. *
  20. * Internally also locks the SHA peripheral, as the HMAC depends on the SHA peripheral
  21. */
  22. void esp_crypto_hmac_lock_acquire(void);
  23. /**
  24. * @brief Release lock for HMAC cryptography peripheral
  25. *
  26. * Internally also releases the SHA peripheral, as the HMAC depends on the SHA peripheral
  27. */
  28. void esp_crypto_hmac_lock_release(void);
  29. /**
  30. * @brief Acquire lock for DS cryptography peripheral
  31. *
  32. * Internally also locks the HMAC (which locks SHA), AES and MPI peripheral, as the DS depends on these peripherals
  33. */
  34. void esp_crypto_ds_lock_acquire(void);
  35. /**
  36. * @brief Release lock for DS cryptography peripheral
  37. *
  38. * Internally also releases the HMAC (which locks SHA), AES and MPI peripheral, as the DS depends on these peripherals
  39. */
  40. void esp_crypto_ds_lock_release(void);
  41. /**
  42. * @brief Acquire lock for the SHA cryptography peripheral.
  43. *
  44. */
  45. void esp_crypto_sha_lock_acquire(void);
  46. /**
  47. * @brief Release lock for the SHA cryptography peripheral.
  48. *
  49. */
  50. void esp_crypto_sha_lock_release(void);
  51. /**
  52. * @brief Acquire lock for the aes cryptography peripheral.
  53. *
  54. */
  55. void esp_crypto_aes_lock_acquire(void);
  56. /**
  57. * @brief Release lock for the aes cryptography peripheral.
  58. *
  59. */
  60. void esp_crypto_aes_lock_release(void);
  61. /**
  62. * @brief Acquire lock for the mpi cryptography peripheral.
  63. *
  64. */
  65. void esp_crypto_mpi_lock_acquire(void);
  66. /**
  67. * @brief Release lock for the mpi/rsa cryptography peripheral.
  68. *
  69. */
  70. void esp_crypto_mpi_lock_release(void);
  71. #ifdef __cplusplus
  72. }
  73. #endif