From a549360201f2cbca27e285b33dff817ad1e6dff3 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 27 May 2015 16:57:51 +0200 Subject: [PATCH] Display actual data, do not suggest that the nonce is part of the ciphertext --- demos/auth.c | 4 +--- demos/box.c | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/demos/auth.c b/demos/auth.c index e1ae9b85..bcabbb69 100644 --- a/demos/auth.c +++ b/demos/auth.c @@ -57,10 +57,8 @@ auth(void) printf("Generating %s authentication...\n", crypto_auth_primitive()); crypto_auth(mac, message, message_len, key); - puts("Format: authentication tag::message"); + fputs("Authentication tag: ", stdout); print_hex(mac, sizeof mac); - fputs("::", stdout); - puts((const char*)message); putchar('\n'); puts("Verifying authentication tag..."); diff --git a/demos/box.c b/demos/box.c index 4ae41649..7e33d9e4 100644 --- a/demos/box.c +++ b/demos/box.c @@ -112,11 +112,11 @@ box(void) puts("Bob sends the ciphertext...\n"); printf("Ciphertext len: %zu bytes - Original message length: %zu bytes\n", ciphertext_len, message_len); - puts("Notice the prepended 16 byte authentication token"); - puts("Format: nonce::encrypted_message"); + puts("Notice the prepended 16 byte authentication token\n"); + fputs("Nonce: ", stdout); + print_hex(ciphertext, ciphertext_len); + putchar('\n'); fputs("Ciphertext: ", stdout); - print_hex(nonce, sizeof nonce); - fputs("::", stdout); print_hex(ciphertext, ciphertext_len); putchar('\n'); putchar('\n');