@@ -22,7 +22,7 @@ static struct timerel const_time_test(struct secret *s1,
22
22
struct secret * s2 ,
23
23
size_t off )
24
24
{
25
- struct timeabs start , end ;
25
+ struct timemono start , end ;
26
26
int result = 0 ;
27
27
28
28
memset (s1 , 0 , RUNS * sizeof (* s1 ));
@@ -31,16 +31,16 @@ static struct timerel const_time_test(struct secret *s1,
31
31
for (size_t i = 0 ; i < RUNS ; i ++ )
32
32
s2 [i ].data [off ] = i ;
33
33
34
- start = time_now ();
34
+ start = time_mono ();
35
35
for (size_t i = 0 ; i < RUNS ; i ++ )
36
36
result += secret_eq_consttime (& s1 [i ], & s2 [i ]);
37
- end = time_now ();
37
+ end = time_mono ();
38
38
39
39
if (result != RUNS / 256 )
40
40
errx (1 , "Expected %u successes at offset %zu, not %u!" ,
41
41
RUNS / 256 , off , result );
42
42
43
- return time_between (end , start );
43
+ return timemono_between (end , start );
44
44
}
45
45
46
46
static inline bool secret_eq_nonconst (const struct secret * a ,
@@ -53,7 +53,7 @@ static struct timerel nonconst_time_test(struct secret *s1,
53
53
struct secret * s2 ,
54
54
size_t off )
55
55
{
56
- struct timeabs start , end ;
56
+ struct timemono start , end ;
57
57
int result = 0 ;
58
58
59
59
memset (s1 , 0 , RUNS * sizeof (* s1 ));
@@ -62,16 +62,16 @@ static struct timerel nonconst_time_test(struct secret *s1,
62
62
for (size_t i = 0 ; i < RUNS ; i ++ )
63
63
s2 [i ].data [off ] = i ;
64
64
65
- start = time_now ();
65
+ start = time_mono ();
66
66
for (size_t i = 0 ; i < RUNS ; i ++ )
67
67
result += secret_eq_nonconst (& s1 [i ], & s2 [i ]);
68
- end = time_now ();
68
+ end = time_mono ();
69
69
70
70
if (result != RUNS / 256 )
71
71
errx (1 , "Expected %u successes at offset %zu, not %u!" ,
72
72
RUNS / 256 , off , result );
73
73
74
- return time_between (end , start );
74
+ return timemono_between (end , start );
75
75
}
76
76
77
77
static struct secret * s1 , * s2 ;
0 commit comments