Show correct cipher

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2019-10-05 06:05:34 +00:00
parent 65f636555b
commit 0c82c06119
3 changed files with 6 additions and 5 deletions

View File

@@ -50,7 +50,7 @@ gt_bench(int argc, char **argv)
randombytes_buf(key, sizeof(key)); randombytes_buf(key, sizeof(key));
if (term) { if (term) {
printf("cipher: %s\n\n", chacha ? "chacha20poly1305" : "aegis256"); printf("cipher: %s\n\n", GT_CIPHER(chacha));
printf(" size min mean max \n"); printf(" size min mean max \n");
printf("----------------------------------------------------\n"); printf("----------------------------------------------------\n");
} }
@@ -108,8 +108,7 @@ gt_bench(int argc, char **argv)
printf("\n"); printf("\n");
} else { } else {
printf("bench %s %"PRIi64" %"PRIi64" %"PRIi64" %"PRIi64"\n", printf("bench %s %"PRIi64" %"PRIi64" %"PRIi64" %"PRIi64"\n",
chacha ? "chacha20poly1305" : "aegis256", GT_CIPHER(chacha), size, mbps.min, mbps.mean, mbps.max);
size, mbps.min, mbps.mean, mbps.max);
} }
size += 2 * 5 * 13; size += 2 * 5 * 13;

View File

@@ -54,6 +54,8 @@
#undef MIN #undef MIN
#define MIN(x,y) ({ __typeof__(x) X=(x); __typeof__(y) Y=(y); X < Y ? X : Y; }) #define MIN(x,y) ({ __typeof__(x) X=(x); __typeof__(y) Y=(y); X < Y ? X : Y; })
#define GT_CIPHER(x) ((x) ? "chacha20poly1305" : "aegis256")
extern volatile sig_atomic_t gt_alarm; extern volatile sig_atomic_t gt_alarm;
extern volatile sig_atomic_t gt_reload; extern volatile sig_atomic_t gt_reload;
extern volatile sig_atomic_t gt_quit; extern volatile sig_atomic_t gt_quit;

View File

@@ -47,7 +47,7 @@ gt_show_status(int fd)
bindstr[0] ? bindstr : "-", bindstr[0] ? bindstr : "-",
gt_get_port((struct sockaddr *)&res.status.bind), gt_get_port((struct sockaddr *)&res.status.bind),
res.status.mtu, res.status.mtu,
res.status.chacha ? "chacha20poly1305" : "aes256gcm"); GT_CIPHER(res.status.chacha));
} else { } else {
printf(term ? "client %s:\n" printf(term ? "client %s:\n"
" pid: %li\n" " pid: %li\n"
@@ -69,7 +69,7 @@ gt_show_status(int fd)
peerstr[0] ? peerstr : "-", peerstr[0] ? peerstr : "-",
gt_get_port((struct sockaddr *)&res.status.peer), gt_get_port((struct sockaddr *)&res.status.peer),
res.status.mtu, res.status.mtu,
res.status.chacha ? "chacha20poly1305" : "aes256gcm"); GT_CIPHER(res.status.chacha));
} }
return 0; return 0;