}
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);
- 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;
for(clock_start(); clock_countto(duration);)
if(!ecdsa_sign(key1, buf1, 256, buf2))
return 1;
- fprintf(stderr, "%22.2lf op/s\n", rate);
+ fprintf(stderr, "%20.2lf op/s\n", rate);
fprintf(stderr, "Ed25519 verify for %lg seconds: ", duration);
for(clock_start(); clock_countto(duration);)
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);