projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sr.ht CI: update FreeBSD and OpenBSD image versions
[tinc]
/
src
/
sptps_speed.c
diff --git
a/src/sptps_speed.c
b/src/sptps_speed.c
index
cc05b86
..
c7c6e54
100644
(file)
--- a/
src/sptps_speed.c
+++ b/
src/sptps_speed.c
@@
-29,6
+29,7
@@
#include "meta.h"
#include "protocol.h"
#include "sptps.h"
#include "meta.h"
#include "protocol.h"
#include "sptps.h"
+#include "random.h"
// Symbols necessary to link with logger.o
bool send_request(struct connection_t *c, const char *msg, ...) {
// Symbols necessary to link with logger.o
bool send_request(struct connection_t *c, const char *msg, ...) {
@@
-45,7
+46,6
@@
bool send_meta(struct connection_t *c, const void *msg, size_t len) {
(void)len;
return false;
}
(void)len;
return false;
}
-char *logfilename = NULL;
bool do_detach = false;
struct timeval now;
bool do_detach = false;
struct timeval now;
@@
-105,15
+105,13
@@
static bool clock_countto(double seconds) {
return false;
}
return false;
}
-
int main
(int argc, char *argv[]) {
+
static int run_benchmark
(int argc, char *argv[]) {
ecdsa_t *key1, *key2;
ecdh_t *ecdh1, *ecdh2;
sptps_t sptps1, sptps2;
uint8_t buf1[4096], buf2[4096], buf3[4096];
double duration = argc > 1 ? atof(argv[1]) : 10;
ecdsa_t *key1, *key2;
ecdh_t *ecdh1, *ecdh2;
sptps_t sptps1, sptps2;
uint8_t buf1[4096], buf2[4096], buf3[4096];
double duration = argc > 1 ? atof(argv[1]) : 10;
- crypto_init();
-
randomize(buf1, sizeof(buf1));
randomize(buf2, sizeof(buf2));
randomize(buf3, sizeof(buf3));
randomize(buf1, sizeof(buf1));
randomize(buf2, sizeof(buf2));
randomize(buf3, sizeof(buf3));
@@
-317,7
+315,17
@@
int main(int argc, char *argv[]) {
close(fd[1]);
ecdsa_free(key1);
ecdsa_free(key2);
close(fd[1]);
ecdsa_free(key1);
ecdsa_free(key2);
- crypto_exit();
return 0;
}
return 0;
}
+
+int main(int argc, char *argv[]) {
+ random_init();
+ crypto_init();
+
+ int result = run_benchmark(argc, argv);
+
+ random_exit();
+
+ return result;
+}