projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove checks for non-C99 compliant compilers.
[tinc]
/
src
/
sptps_speed.c
diff --git
a/src/sptps_speed.c
b/src/sptps_speed.c
index
4cb1221
..
bde3d69
100644
(file)
--- a/
src/sptps_speed.c
+++ b/
src/sptps_speed.c
@@
-47,11
+47,16
@@
static bool receive_record(void *handle, uint8_t type, const void *data, uint16_
}
static void receive_data(sptps_t *sptps) {
}
static void receive_data(sptps_t *sptps) {
- char buf[4096];
+ char buf[4096]
, *bufp = buf
;
int fd = *(int *)sptps->handle;
size_t len = recv(fd, buf, sizeof buf, 0);
int fd = *(int *)sptps->handle;
size_t len = recv(fd, buf, sizeof buf, 0);
- if(!sptps_receive_data(sptps, buf, len))
- abort();
+ while(len) {
+ size_t done = sptps_receive_data(sptps, bufp, len);
+ if(!done)
+ abort();
+ bufp += done;
+ len -= done;
+ }
}
struct timespec start;
}
struct timespec start;
@@
-104,7
+109,7
@@
int main(int argc, char *argv[]) {
for(clock_start(); clock_countto(duration);)
if(!ecdsa_sign(key1, buf1, 256, buf2))
return 1;
for(clock_start(); clock_countto(duration);)
if(!ecdsa_sign(key1, buf1, 256, buf2))
return 1;
- fprintf(stderr, "%2
2
.2lf op/s\n", rate);
+ fprintf(stderr, "%2
0
.2lf op/s\n", rate);
fprintf(stderr, "Ed25519 verify for %lg seconds: ", duration);
for(clock_start(); clock_countto(duration);)
fprintf(stderr, "Ed25519 verify for %lg seconds: ", duration);
for(clock_start(); clock_countto(duration);)
@@
-112,7
+117,7
@@
int main(int argc, char *argv[]) {
fprintf(stderr, "Signature verification failed\n");
return 1;
}
fprintf(stderr, "Signature verification failed\n");
return 1;
}
- fprintf(stderr, "%
20
.2lf op/s\n", rate);
+ fprintf(stderr, "%
18
.2lf op/s\n", rate);
ecdh1 = ecdh_generate_public(buf1);
fprintf(stderr, "ECDH for %lg seconds: ", duration);
ecdh1 = ecdh_generate_public(buf1);
fprintf(stderr, "ECDH for %lg seconds: ", duration);