MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / CalculateSum8

Function CalculateSum8

BaseTools/Source/C/Common/CommonLib.c:348–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348UINT8
349CalculateSum8 (
350 IN UINT8 *Buffer,
351 IN UINTN Size
352 )
353/*++
354
355Routine Description::
356
357 This function calculates the UINT8 sum for the requested region.
358
359Arguments:
360
361 Buffer Pointer to buffer containing byte data of component.
362 Size Size of the buffer
363
364Returns:
365
366 The 8 bit checksum value needed.
367
368--*/
369{
370 UINTN Index;
371 UINT8 Sum;
372
373 Sum = 0;
374
375 //
376 // Perform the byte sum for buffer
377 //
378 for (Index = 0; Index < Size; Index++) {
379 Sum = (UINT8) (Sum + Buffer[Index]);
380 }
381
382 return Sum;
383}
384
385UINT16
386CalculateChecksum16 (

Callers 3

CalculateChecksum8Function · 0.70
VerifyFfsFileFunction · 0.70
PrintFileInfoFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected