mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-26 11:47:13 +09:00
Display actual data, do not suggest that the nonce is part of the ciphertext
This commit is contained in:
+1
-3
@@ -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...");
|
||||
|
||||
+4
-4
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user