diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2016-03-22 13:22:01 +0100 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2016-03-24 18:52:48 +0100 |
commit | b12c53ce77beb8e04b044d0c0dc9249ddba72200 (patch) | |
tree | fc73241398d3ee6850e4aee0d24a863d43abb010 /scripts/timeattack.c | |
parent | b210369314cd1e0f889fd1b73dae4d45baa968a8 (diff) | |
download | strongswan-b12c53ce77beb8e04b044d0c0dc9249ddba72200.tar.bz2 strongswan-b12c53ce77beb8e04b044d0c0dc9249ddba72200.tar.xz |
Use standard unsigned integer types
Diffstat (limited to 'scripts/timeattack.c')
-rw-r--r-- | scripts/timeattack.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/timeattack.c b/scripts/timeattack.c index ef00e8c4e..e3505dd9a 100644 --- a/scripts/timeattack.c +++ b/scripts/timeattack.c @@ -10,7 +10,7 @@ static void start_timing(struct timespec *start) clock_gettime(CLOCK_PROCESS_CPUTIME_ID, start); } -static u_int64_t end_timing(struct timespec *start) +static uint64_t end_timing(struct timespec *start) { struct timespec end; @@ -21,12 +21,12 @@ static u_int64_t end_timing(struct timespec *start) static int intcmp(const void *a, const void *b) { - return *(u_int64_t*)a - *(u_int64_t*)b; + return *(uint64_t*)a - *(uint64_t*)b; } -static u_int64_t median(u_int64_t *m, int count) +static uint64_t median(uint64_t *m, int count) { - qsort(m, count, sizeof(u_int64_t), intcmp); + qsort(m, count, sizeof(uint64_t), intcmp); return m[count / 2]; } @@ -35,7 +35,7 @@ static bool timeattack(attackfn_t attackfn, void *subj, size_t dlen, { struct timespec start; u_char test[dlen]; - u_int64_t mini, maxi, t[256], m[256][10]; + uint64_t mini, maxi, t[256], m[256][10]; float fastdist = 0, slowdist = 0; int i, j, k, l, byte, limit, retry = 0; int fastest = 0, slowest = 0; |