]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/BaseLib.h
MdePkg/BaseLib: Add CRC16-ANSI and CRC32c implementations
[mirror_edk2.git] / MdePkg / Include / Library / BaseLib.h
index 9d58a7c4ad13e5a9eb240639370e3f964156e9c6..a6f9a194ef1c2898fd0ea4df4e3463dbaf17d14d 100644 (file)
@@ -4503,6 +4503,40 @@ CalculateCrc32 (
   IN  UINTN  Length\r
   );\r
 \r
+/**\r
+   Calculates the CRC16-ANSI checksum of the given buffer.\r
+\r
+   @param[in]      Buffer        Pointer to the buffer.\r
+   @param[in]      Length        Length of the buffer, in bytes.\r
+   @param[in]      InitialValue  Initial value of the CRC.\r
+\r
+   @return The CRC16-ANSI checksum.\r
+**/\r
+UINT16\r
+EFIAPI\r
+CalculateCrc16Ansi (\r
+  IN  CONST VOID  *Buffer,\r
+  IN  UINTN       Length,\r
+  IN  UINT16      InitialValue\r
+  );\r
+\r
+/**\r
+   Calculates the CRC32c checksum of the given buffer.\r
+\r
+   @param[in]      Buffer        Pointer to the buffer.\r
+   @param[in]      Length        Length of the buffer, in bytes.\r
+   @param[in]      InitialValue  Initial value of the CRC.\r
+\r
+   @return The CRC32c checksum.\r
+**/\r
+UINT32\r
+EFIAPI\r
+CalculateCrc32c (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINT32      InitialValue\r
+  );\r
+\r
 //\r
 // Base Library CPU Functions\r
 //\r
@@ -4512,7 +4546,6 @@ CalculateCrc32 (
 \r
   @param  Context1        Context1 parameter passed into SwitchStack().\r
   @param  Context2        Context2 parameter passed into SwitchStack().\r
-\r
 **/\r
 typedef\r
 VOID\r