| 346 | } |
| 347 | |
| 348 | UINT8 |
| 349 | CalculateSum8 ( |
| 350 | IN UINT8 *Buffer, |
| 351 | IN UINTN Size |
| 352 | ) |
| 353 | /*++ |
| 354 | |
| 355 | Routine Description:: |
| 356 | |
| 357 | This function calculates the UINT8 sum for the requested region. |
| 358 | |
| 359 | Arguments: |
| 360 | |
| 361 | Buffer Pointer to buffer containing byte data of component. |
| 362 | Size Size of the buffer |
| 363 | |
| 364 | Returns: |
| 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 | |
| 385 | UINT16 |
| 386 | CalculateChecksum16 ( |
no outgoing calls
no test coverage detected