]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptArc4Null.c
Add interfaces to several library instances of BaseCryptLib.
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLibRuntimeCryptProtocol / Cipher / CryptArc4Null.c
diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptArc4Null.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptArc4Null.c
new file mode 100644 (file)
index 0000000..1275e20
--- /dev/null
@@ -0,0 +1,130 @@
+/** @file \r
+  ARC4 Wrapper Implementation which does not provide real capabilities.\r
+\r
+Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "InternalCryptLib.h"\r
+\r
+/**\r
+  Retrieves the size, in bytes, of the context buffer required for ARC4 operations.\r
+\r
+  Return zero to indicate this interface is not supported.\r
+\r
+  @retval  0   This interface is not supported.\r
+\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+Arc4GetContextSize (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return 0;\r
+}\r
+\r
+/**\r
+  Initializes user-supplied memory as ARC4 context for subsequent use.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[out]  Arc4Context  Pointer to ARC4 context being initialized.\r
+  @param[in]   Key          Pointer to the user-supplied ARC4 key.\r
+  @param[in]   KeySize      Size of ARC4 key in bytes.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+Arc4Init (\r
+  OUT  VOID         *Arc4Context,\r
+  IN   CONST UINT8  *Key,\r
+  IN   UINTN        KeySize\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Performs ARC4 encryption on a data buffer of the specified size.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
+  @param[in]       Input        Pointer to the buffer containing the data to be encrypted.\r
+  @param[in]       InputSize    Size of the Input buffer in bytes.\r
+  @param[out]      Output       Pointer to a buffer that receives the ARC4 encryption output.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+Arc4Encrypt (\r
+  IN OUT  VOID         *Arc4Context,\r
+  IN      CONST UINT8  *Input,\r
+  IN      UINTN        InputSize,\r
+  OUT     UINT8        *Output\r
+  )\r
+{ \r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Performs ARC4 decryption on a data buffer of the specified size.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
+  @param[in]       Input        Pointer to the buffer containing the data to be decrypted.\r
+  @param[in]       InputSize    Size of the Input buffer in bytes.\r
+  @param[out]      Output       Pointer to a buffer that receives the ARC4 decryption output.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+Arc4Decrypt (\r
+  IN OUT  VOID   *Arc4Context,\r
+  IN      UINT8  *Input,\r
+  IN      UINTN  InputSize,\r
+  OUT     UINT8  *Output\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Resets the ARC4 context to the initial state.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+Arc4Reset (\r
+  IN OUT  VOID  *Arc4Context\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r