LCOV - code coverage report
Current view: top level - os_stub/memlib - compare_mem.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 7 7
Test Date: 2025-06-29 08:09:00 Functions: 100.0 % 1 1

            Line data    Source code
       1              : /**
       2              :  *  Copyright Notice:
       3              :  *  Copyright 2021-2022 DMTF. All rights reserved.
       4              :  *  License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
       5              :  **/
       6              : 
       7              : #include "base.h"
       8              : 
       9        14507 : bool libspdm_consttime_is_mem_equal(const void *destination_buffer,
      10              :                                     const void *source_buffer, size_t length)
      11              : {
      12              :     const volatile uint8_t *pointer_dst;
      13              :     const volatile uint8_t *pointer_src;
      14              :     uint8_t delta;
      15              : 
      16        14507 :     pointer_dst = (const uint8_t *)destination_buffer;
      17        14507 :     pointer_src = (const uint8_t *)source_buffer;
      18        14507 :     delta = 0;
      19       164344 :     while ((length-- != 0)) {
      20       149837 :         delta |= *(pointer_dst++) ^ *(pointer_src++);
      21              :     }
      22              : 
      23        14507 :     return ((delta == 0) ? true : false);
      24              : }
        

Generated by: LCOV version 2.0-1