sign demo: print signature and message separately

This commit is contained in:
Frank Denis 2015-05-27 20:00:05 +02:00
parent 9060457fac
commit a67f42e015

View File

@ -60,12 +60,12 @@ sign(void)
putchar('\n');
putchar('\n');
puts("Format: signature::message");
fputs("Signed: ", stdout);
fputs("Signature: ", stdout);
print_hex(sm, crypto_sign_BYTES);
fputs("::", stdout);
puts((const char*)sm + crypto_sign_BYTES);
putc('\n', stdout);
putchar('\n');
fputs("Message: ", stdout);
fwrite(sm + crypto_sign_BYTES, 1U, smlen - crypto_sign_BYTES, stdout);
putchar('\n');
puts("Validating message...");
r = crypto_sign_open(m, &mlen, sm, smlen, pk);