LCOV - code coverage report
Current view: top level - shared - random.c (source / functions) Coverage Total Hit
Test: hslock host coverage Lines: 100.0 % 8 8
Test Date: 2026-07-09 13:15:11 Functions: 100.0 % 1 1
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : #include "random.h"
       2                 :             : #include <string.h>
       3                 :             : 
       4                 :           1 : void generate_secret(uint8_t *out) {
       5                 :             :     // 20 bytes = 2.5 x uint64_t - fill in 64-bit chunks
       6                 :           1 :     uint64_t r0 = get_rand_64();
       7                 :           1 :     uint64_t r1 = get_rand_64();
       8                 :           1 :     uint64_t r2 = get_rand_64(); // only 4 bytes used from this one
       9                 :             : 
      10                 :           1 :     memcpy(out, &r0, 8);
      11                 :           1 :     memcpy(out + 8, &r1, 8);
      12                 :           1 :     memcpy(out + 16, &r2, 4);
      13                 :           1 : }
        

Generated by: LCOV version 2.0-1