diff options
author | Paul Duncan <pabs@pablotron.org> | 2023-09-05 02:23:41 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2023-09-05 02:23:41 -0400 |
commit | f6309d8dff9b17a42d2983fc2aa5613909a839e8 (patch) | |
tree | 291084aaf5e498c0e9a5f627d1e8b480e8f05d7e | |
parent | e82db21bff8ece5218ac5b87d2087a8db0f55dc9 (diff) | |
download | sha3-0.1.tar.bz2 sha3-0.1.zip |
main.c: add header and shake128-xof example to helpv0.1
-rw-r--r-- | main.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,4 @@ +// main.c: sha3 test application #include <stdbool.h> #include <stdlib.h> #include <stdio.h> @@ -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; } |