Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/compat/timingsafe_memcmp.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | int | - | ||||||
3 | timingsafe_memcmp(const void *b1, const void *b2, size_t len) | - | ||||||
4 | { | - | ||||||
5 | const unsigned char *p1 = b1, *p2 = b2; | - | ||||||
6 | size_t i; | - | ||||||
7 | int res = 0, done = 0; | - | ||||||
8 | - | |||||||
9 | for (i = 0; i < len
| 362069-2929930 | ||||||
10 | - | |||||||
11 | int lt = (p1[i] - p2[i]) >> 8; | - | ||||||
12 | - | |||||||
13 | - | |||||||
14 | int gt = (p2[i] - p1[i]) >> 8; | - | ||||||
15 | - | |||||||
16 | - | |||||||
17 | int cmp = lt - gt; | - | ||||||
18 | - | |||||||
19 | - | |||||||
20 | res |= cmp & ~done; | - | ||||||
21 | - | |||||||
22 | - | |||||||
23 | done |= lt | gt; | - | ||||||
24 | } executed 2929930 times by 8 tests: end of block Executed by:
| 2929930 | ||||||
25 | - | |||||||
26 | return executed 362069 times by 8 tests: (res);return (res); Executed by:
executed 362069 times by 8 tests: return (res); Executed by:
| 362069 | ||||||
27 | } | - | ||||||
Switch to Source code | Preprocessed file |