From f6309d8dff9b17a42d2983fc2aa5613909a839e8 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 5 Sep 2023 02:23:41 -0400 Subject: main.c: add header and shake128-xof example to help --- main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index bf58269..379d0ec 100644 --- a/main.c +++ b/main.c @@ -1,3 +1,4 @@ +// main.c: sha3 test application #include #include #include @@ -126,15 +127,20 @@ static size_t get_fn_ofs(const char * const name) { "- shake128-xof (XOF)\n" \ "- shake256-xof (XOF)\n" \ "\n" \ - "Example:\n" \ + "Examples:\n" \ + " # get SHA3-256 hash of string \"asdf\"\n" \ " %s sha3-256 \"asdf\"\n" \ - " dd2781f4c51bccdbe23e4d398b8a82261f585c278dbb4b84989fea70e76723a9\n" + " dd2781f4c51bccdbe23e4d398b8a82261f585c278dbb4b84989fea70e76723a9\n" \ + "\n" \ + " # get first 40 bytes of SHAKE128-XOF output of string \"foo\"\n" \ + " %s shake128-xof foo 40\n" \ + " f84e95cb5fbd2038863ab27d3cdeac295ad2d4ab96ad1f4b070c0bf36078ef0881db3194a9d0f3dd\n" int main(int argc, char *argv[]) { // check command-line arguments if (argc < 3) { const char *app = (argc > 0) ? argv[0] : "sha3"; - fprintf(stderr, USAGE, app, app); + fprintf(stderr, USAGE, app, app, app); return -1; } -- cgit v1.2.3