CryptAesNull.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /** @file
  2. AES Wrapper Implementation which does not provide real capabilities.
  3. Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #include "InternalCryptLib.h"
  7. /**
  8. Retrieves the size, in bytes, of the context buffer required for AES operations.
  9. Return zero to indicate this interface is not supported.
  10. @retval 0 This interface is not supported.
  11. **/
  12. UINTN
  13. EFIAPI
  14. AesGetContextSize (
  15. VOID
  16. )
  17. {
  18. ASSERT (FALSE);
  19. return 0;
  20. }
  21. /**
  22. Initializes user-supplied memory as AES context for subsequent use.
  23. Return FALSE to indicate this interface is not supported.
  24. @param[out] AesContext Pointer to AES context being initialized.
  25. @param[in] Key Pointer to the user-supplied AES key.
  26. @param[in] KeyLength Length of AES key in bits.
  27. @retval FALSE This interface is not supported.
  28. **/
  29. BOOLEAN
  30. EFIAPI
  31. AesInit (
  32. OUT VOID *AesContext,
  33. IN CONST UINT8 *Key,
  34. IN UINTN KeyLength
  35. )
  36. {
  37. ASSERT (FALSE);
  38. return FALSE;
  39. }
  40. /**
  41. Performs AES encryption on a data buffer of the specified size in ECB mode.
  42. Return FALSE to indicate this interface is not supported.
  43. @param[in] AesContext Pointer to the AES context.
  44. @param[in] Input Pointer to the buffer containing the data to be encrypted.
  45. @param[in] InputSize Size of the Input buffer in bytes.
  46. @param[out] Output Pointer to a buffer that receives the AES encryption output.
  47. @retval FALSE This interface is not supported.
  48. **/
  49. BOOLEAN
  50. EFIAPI
  51. AesEcbEncrypt (
  52. IN VOID *AesContext,
  53. IN CONST UINT8 *Input,
  54. IN UINTN InputSize,
  55. OUT UINT8 *Output
  56. )
  57. {
  58. ASSERT (FALSE);
  59. return FALSE;
  60. }
  61. /**
  62. Performs AES decryption on a data buffer of the specified size in ECB mode.
  63. Return FALSE to indicate this interface is not supported.
  64. @param[in] AesContext Pointer to the AES context.
  65. @param[in] Input Pointer to the buffer containing the data to be decrypted.
  66. @param[in] InputSize Size of the Input buffer in bytes.
  67. @param[out] Output Pointer to a buffer that receives the AES decryption output.
  68. @retval FALSE This interface is not supported.
  69. **/
  70. BOOLEAN
  71. EFIAPI
  72. AesEcbDecrypt (
  73. IN VOID *AesContext,
  74. IN CONST UINT8 *Input,
  75. IN UINTN InputSize,
  76. OUT UINT8 *Output
  77. )
  78. {
  79. ASSERT (FALSE);
  80. return FALSE;
  81. }
  82. /**
  83. Performs AES encryption on a data buffer of the specified size in CBC mode.
  84. Return FALSE to indicate this interface is not supported.
  85. @param[in] AesContext Pointer to the AES context.
  86. @param[in] Input Pointer to the buffer containing the data to be encrypted.
  87. @param[in] InputSize Size of the Input buffer in bytes.
  88. @param[in] Ivec Pointer to initialization vector.
  89. @param[out] Output Pointer to a buffer that receives the AES encryption output.
  90. @retval FALSE This interface is not supported.
  91. **/
  92. BOOLEAN
  93. EFIAPI
  94. AesCbcEncrypt (
  95. IN VOID *AesContext,
  96. IN CONST UINT8 *Input,
  97. IN UINTN InputSize,
  98. IN CONST UINT8 *Ivec,
  99. OUT UINT8 *Output
  100. )
  101. {
  102. ASSERT (FALSE);
  103. return FALSE;
  104. }
  105. /**
  106. Performs AES decryption on a data buffer of the specified size in CBC mode.
  107. Return FALSE to indicate this interface is not supported.
  108. @param[in] AesContext Pointer to the AES context.
  109. @param[in] Input Pointer to the buffer containing the data to be encrypted.
  110. @param[in] InputSize Size of the Input buffer in bytes.
  111. @param[in] Ivec Pointer to initialization vector.
  112. @param[out] Output Pointer to a buffer that receives the AES encryption output.
  113. @retval FALSE This interface is not supported.
  114. **/
  115. BOOLEAN
  116. EFIAPI
  117. AesCbcDecrypt (
  118. IN VOID *AesContext,
  119. IN CONST UINT8 *Input,
  120. IN UINTN InputSize,
  121. IN CONST UINT8 *Ivec,
  122. OUT UINT8 *Output
  123. )
  124. {
  125. ASSERT (FALSE);
  126. return FALSE;
  127. }