diff options
author | Mattias Andrée <maandree@kth.se> | 2019-02-10 23:19:58 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2019-02-10 23:19:58 +0100 |
commit | c461a856bc3bca4b1190cf46a1d8a4f401f79b5c (patch) | |
tree | dae918632e8bfc1f3d0c23f00a23e7c2e68db4ef /man3 | |
parent | Add test from github issue #10 (diff) | |
download | libkeccak-c461a856bc3bca4b1190cf46a1d8a4f401f79b5c.tar.gz libkeccak-c461a856bc3bca4b1190cf46a1d8a4f401f79b5c.tar.bz2 libkeccak-c461a856bc3bca4b1190cf46a1d8a4f401f79b5c.tar.xz |
General API improvements
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'man3')
56 files changed, 262 insertions, 566 deletions
diff --git a/man3/libkeccak_behex_lower.3 b/man3/libkeccak_behex_lower.3 index 85bc843..2078790 100644 --- a/man3/libkeccak_behex_lower.3 +++ b/man3/libkeccak_behex_lower.3 @@ -1,16 +1,14 @@ .TH LIBKECCAK_BEHEX_LOWER 3 LIBKECCAK .SH NAME -libkeccak_behex_lower - Converts a binary hashsum to lowercase hexadecimal +libkeccak_behex_lower - Converts a binary hashsum to lower case hexadecimal .SH SYNOPSIS .LP .nf #include <libkeccak.h> -.P -void -libkeccak_behex_lower(char *restrict \fIoutput\fP, - const char *restrict \fIhashsum\fP, size_t \fIn\fP); + +void libkeccak_behex_lower(char *restrict \fIoutput\fP, const void *restrict \fIhashsum\fP, size_t \fIn\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -45,6 +43,3 @@ function cannot fail. .SH SEE ALSO .BR libkeccak_behex_upper (3), .BR libkeccak_unhex (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_behex_upper.3 b/man3/libkeccak_behex_upper.3 index 7925efc..b5c67bb 100644 --- a/man3/libkeccak_behex_upper.3 +++ b/man3/libkeccak_behex_upper.3 @@ -1,16 +1,13 @@ .TH LIBKECCAK_BEHEX_UPPER 3 LIBKECCAK .SH NAME -libkeccak_behex_upper - Converts a binary hashsum to uppercase hexadecimal +libkeccak_behex_upper - Converts a binary hashsum to upper case hexadecimal .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_behex_upper(char *restrict \fIoutput\fP, - const char *restrict \fIhashsum\fP, size_t \fIn\fP); + +void libkeccak_behex_upper(char *restrict \fIoutput\fP, const void *restrict \fIhashsum\fP, size_t \fIn\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -45,6 +42,3 @@ function cannot fail. .SH SEE ALSO .BR libkeccak_behex_lower (3), .BR libkeccak_unhex (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_degeneralise_spec.3 b/man3/libkeccak_degeneralise_spec.3 index 38a1b73..7ec2b72 100644 --- a/man3/libkeccak_degeneralise_spec.3 +++ b/man3/libkeccak_degeneralise_spec.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_degeneralise_spec - Set all specification parameters to automatic .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_degeneralise_spec(libkeccak_generalised_spec_t *\fIspec\fP, - libkeccak_spec_t *\fIoutput_spec\fP); + +int libkeccak_degeneralise_spec(libkeccak_generalised_spec_t *\fIspec\fP, libkeccak_spec_t *\fIoutput_spec\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -34,11 +31,11 @@ function after calling .PP .nf typedef struct libkeccak_generalised_spec { - long int bitrate; /* bitrate (in bits) */ - long int capacity; /* capacity (in bits) */ - long int output; /* output size (in bits) */ - long int state_size; /* state size (in bits) */ - long int word_size; /* word size (in bits) */ + long int bitrate; /* bitrate (in bits) */ + long int capacity; /* capacity (in bits) */ + long int output; /* output size (in bits) */ + long int state_size; /* state size (in bits) */ + long int word_size; /* word size (in bits) */ } libkeccak_generalised_spec_t; .fi .SH RETURN VALUES @@ -99,7 +96,7 @@ function cannot fail. This examples configure a .B libkeccak_spec_t to specify settings for Keccak[c = 512]: -.LP +.PP .nf int r; libkeccak_spec_t spec; @@ -119,6 +116,3 @@ if ((r = libkeccak_spec_check(&spec))); .BR libkeccak_spec_shake (3), .BR libkeccak_state_initialise (3), .BR libkeccak_hmac_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_digest.3 b/man3/libkeccak_digest.3 index 33b0479..5f42796 100644 --- a/man3/libkeccak_digest.3 +++ b/man3/libkeccak_digest.3 @@ -2,16 +2,13 @@ .SH NAME libkeccak_digest - Complete the hashing of a message with erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_digest(libkeccak_state_t *\fIstate\fP, const char *\fImsg\fP, - size_t \fImsglen\fP, size_t \fIbits\fP, const char *\fIsuffix\fP, - char *\fIhashsum\fP); + +int libkeccak_digest(libkeccak_state_t *\fIstate\fP, const void *\fImsg\fP, size_t \fImsglen\fP, + size_t \fIbits\fP, const char *\fIsuffix\fP, void *\fIhashsum\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -54,7 +51,7 @@ the message. If this string is empty, may be used instead. This is used to select hash algorithm. For pure Keccak, .I NULL -or "" is used. For the other algorithms the constants +or \(dq\(dq is used. For the other algorithms the constants .B LIBKECCAK_SHA3_SUFFIX (for SHA-3), .B LIBKECCAK_RAWSHAKE_SUFFIX @@ -97,7 +94,7 @@ function may fail for any reason specified by the function This example calculates the Keccak[b = 1024, c = 576, n = 256] hash of the input from stdin, and prints the hash, in hexadecimal form, to stdout. -.LP +.PP .nf libkeccak_state_t state; libkeccak_spec_t spec; @@ -110,26 +107,26 @@ spec.bitrate = 1024; spec.capacity = 576; spec.output = 256; if (libkeccak_state_initialise(&state, &spec) < 0) - goto fail; + goto fail; for (;;) { - len = read(STDIN_FILENO, chunk, sizeof(chunk)); + len = read(STDIN_FILENO, chunk, sizeof(chunk)); - if ((len < 0) && (errno == EINTR)) - continue; - if (len < 0) - goto fail; - if (len == 0) - break; + if ((len < 0) && (errno == EINTR)) + continue; + if (len < 0) + goto fail; + if (len == 0) + break; - if (libkeccak_update(&state, chunk, (size_t)len) < 0) - goto fail; + if (libkeccak_update(&state, chunk, (size_t)len) < 0) + goto fail; } -if (libkeccak_digest(&state, NULL, 0, 0, "", binhash) < 0) - goto fail; +if (libkeccak_digest(&state, NULL, 0, 0, \(dq\(dq, binhash) < 0) + goto fail; libkeccak_behex_lower(hexhash, binhash, sizeof(binhash)); -printf("%s\\n", hexhash); +printf(\(dq%s\en\(dq, hexhash); libkeccak_state_destroy(&state); .fi .SH SEE ALSO @@ -140,6 +137,3 @@ libkeccak_state_destroy(&state); .BR libkeccak_simple_squeeze (3), .BR libkeccak_fast_squeeze (3), .BR libkeccak_squeeze (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_fast_digest.3 b/man3/libkeccak_fast_digest.3 index d5c55a5..9e9c1f3 100644 --- a/man3/libkeccak_fast_digest.3 +++ b/man3/libkeccak_fast_digest.3 @@ -5,11 +5,9 @@ libkeccak_fast_digest - Complete the hashing of a message without erasure .LP .nf #include <libkeccak.h> -.P -int -libkeccak_fast_digest(libkeccak_state_t *\fIstate\fP, const char *\fImsg\fP, - size_t \fImsglen\fP, size_t \fIbits\fP, const char *\fIsuffix\fP, - char *\fIhashsum\fP); + +int libkeccak_fast_digest(libkeccak_state_t *\fIstate\fP, const void *\fImsg\fP, size_t \fImsglen\fP, + size_t \fIbits\fP, const char *\fIsuffix\fP, void *\fIhashsum\fP); .fi .P Link with @@ -54,7 +52,7 @@ message. If this string is empty, may be used instead. This is used to select hash algorithm. For pure Keccak, .I NULL -or "" is used. For the other algorithms the constants +or \(dq\(dq is used. For the other algorithms the constants .B LIBKECCAK_SHA3_SUFFIX (for SHA-3), .B LIBKECCAK_RAWSHAKE_SUFFIX @@ -98,7 +96,7 @@ function may fail for any reason specified by the function This example calculates the Keccak[b = 1024, c = 576, n = 256] hash of the input from stdin, and prints the hash, in hexadecimal form, to stdout. -.LP +.PP .nf libkeccak_state_t state; libkeccak_spec_t spec; @@ -111,26 +109,26 @@ spec.bitrate = 1024; spec.capacity = 576; spec.output = 256; if (libkeccak_state_initialise(&state, &spec) < 0) - goto fail; + goto fail; for (;;) { - len = read(STDIN_FILENO, chunk, sizeof(chunk)); + len = read(STDIN_FILENO, chunk, sizeof(chunk)); - if ((len < 0) && (errno == EINTR)) - continue; - if (len < 0) - goto fail; - if (len == 0) - break; + if ((len < 0) && (errno == EINTR)) + continue; + if (len < 0) + goto fail; + if (len == 0) + break; - if (libkeccak_fast_update(&state, chunk, (size_t)len) < 0) - goto fail; + if (libkeccak_fast_update(&state, chunk, (size_t)len) < 0) + goto fail; } -if (libkeccak_fast_digest(&state, NULL, 0, 0, "", binhash) < 0) - goto fail; +if (libkeccak_fast_digest(&state, NULL, 0, 0, \(dq\(dq, binhash) < 0) + goto fail; libkeccak_behex_lower(hexhash, binhash, sizeof(binhash)); -printf("%s\\n", hexhash); +printf(\(dq%s\en\(dq, hexhash); libkeccak_state_fast_destroy(&state); .fi .SH SEE ALSO @@ -141,6 +139,3 @@ libkeccak_state_fast_destroy(&state); .BR libkeccak_simple_squeeze (3), .BR libkeccak_fast_squeeze (3), .BR libkeccak_squeeze (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_fast_squeeze.3 b/man3/libkeccak_fast_squeeze.3 index d782a95..393e264 100644 --- a/man3/libkeccak_fast_squeeze.3 +++ b/man3/libkeccak_fast_squeeze.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_fast_squeeze - Runs the squeeze phase a number of times .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_fast_squeeze(libkeccak_state_t *\fIstate\fP, long int \fItimes\fP); + +void libkeccak_fast_squeeze(libkeccak_state_t *\fIstate\fP, long int \fItimes\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -34,6 +32,3 @@ function cannot fail. .BR libkeccak_fast_digest (3), .BR libkeccak_simple_squeeze (3), .BR libkeccak_squeeze (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_fast_update.3 b/man3/libkeccak_fast_update.3 index c619e7d..3398984 100644 --- a/man3/libkeccak_fast_update.3 +++ b/man3/libkeccak_fast_update.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_fast_update - Partially hash a message without erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_fast_update(libkeccak_state_t *\fIstate\fP, const char *\fImsg\fP, - size_t \fImsglen\fP); + +int libkeccak_fast_update(libkeccak_state_t *\fIstate\fP, const void *\fImsg\fP, size_t \fImsglen\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -51,7 +48,7 @@ or 0. This example calculates the Keccak[b = 1024, c = 576, n = 256] hash of the input from stdin, and prints the hash, in hexadecimal form, to stdout. -.LP +.PP .nf libkeccak_state_t state; libkeccak_spec_t spec; @@ -64,26 +61,26 @@ spec.bitrate = 1024; spec.capacity = 576; spec.output = 256; if (libkeccak_state_initialise(&state, &spec) < 0) - goto fail; + goto fail; for (;;) { - len = read(STDIN_FILENO, chunk, sizeof(chunk)); + len = read(STDIN_FILENO, chunk, sizeof(chunk)); - if ((len < 0) && (errno == EINTR)) - continue; - if (len < 0) - goto fail; - if (len == 0) - break; + if ((len < 0) && (errno == EINTR)) + continue; + if (len < 0) + goto fail; + if (len == 0) + break; - if (libkeccak_fast_update(&state, chunk, (size_t)len) < 0) - goto fail; + if (libkeccak_fast_update(&state, chunk, (size_t)len) < 0) + goto fail; } -if (libkeccak_fast_digest(&state, NULL, 0, 0, "", binhash) < 0) - goto fail; +if (libkeccak_fast_digest(&state, NULL, 0, 0, \(dq\(dq, binhash) < 0) + goto fail; libkeccak_behex_lower(hexhash, binhash, sizeof(binhash)); -printf("%s\\n", hexhash); +printf(\(dq%s\en\(dq, hexhash); libkeccak_state_fast_destroy(&state); .fi .SH SEE ALSO @@ -91,6 +88,3 @@ libkeccak_state_fast_destroy(&state); .BR libkeccak_update (3), .BR libkeccak_fast_digest (3), .BR libkeccak_digest (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_generalised_spec_initialise.3 b/man3/libkeccak_generalised_spec_initialise.3 index 42bd62f..1a3bccb 100644 --- a/man3/libkeccak_generalised_spec_initialise.3 +++ b/man3/libkeccak_generalised_spec_initialise.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_generalised_spec_initialise - Set all specification parameters to automatic .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_generalised_spec_initialise(libkeccak_generalised_spec_t *\fIspec\fP); + +void libkeccak_generalised_spec_initialise(libkeccak_generalised_spec_t *\fIspec\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -41,6 +39,3 @@ function cannot fail. .BR libkeccak_spec_sha3 (3), .BR libkeccak_spec_rawshake (3), .BR libkeccak_spec_shake (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_generalised_sum_fd.3 b/man3/libkeccak_generalised_sum_fd.3 index 98e6329..bae5bae 100644 --- a/man3/libkeccak_generalised_sum_fd.3 +++ b/man3/libkeccak_generalised_sum_fd.3 @@ -2,16 +2,13 @@ .SH NAME libkeccak_generalised_sum_fd - Calculate the hash of a file .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_generalised_sum_fd(int \fIfd\fP, libkeccak_state_t *\fIstate\fP, - const libkeccak_spec_t *\fIspec\fP, - const char *\fIsuffix\fP, char *\fIhashsum\fP); + +int libkeccak_generalised_sum_fd(int \fIfd\fP, libkeccak_state_t *\fIstate\fP, const libkeccak_spec_t *\fIspec\fP, + const char *\fIsuffix\fP, void *\fIhashsum\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -97,7 +94,7 @@ does not validate the tuning of the algorithm. This example calculates the Keccak[b = 1024, c = 576, n = 256] hash of the input from stdin, and prints the hash, in hexadecimal form, to stdout. -.LP +.PP .nf libkeccak_state_t state; libkeccak_spec_t spec; @@ -109,9 +106,9 @@ spec.capacity = 576; spec.output = 256; if (libkeccak_generalised_sum_fd(STDIN_FILENO, &state, &spec, NULL, binhash) < 0) - goto fail; + goto fail; libkeccak_behex_lower(hexhash, binhash, sizeof(binhash)); -printf("%s\\n", hexhash); +printf(\(dq%s\en\(dq, hexhash); libkeccak_state_destroy(&state); .fi .SH SEE ALSO @@ -127,6 +124,3 @@ libkeccak_state_destroy(&state); .BR libkeccak_spec_check (3), .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_copy.3 b/man3/libkeccak_hmac_copy.3 index f3939f5..0f29ae8 100644 --- a/man3/libkeccak_hmac_copy.3 +++ b/man3/libkeccak_hmac_copy.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_hmac_copy - Copies an HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_hmac_copy(libkeccak_hmac_state_t *\fIdest\fP, - const libkeccak_hmac_state_t *\fIsrc\fP); + +int libkeccak_hmac_copy(libkeccak_hmac_state_t *\fIdest\fP, const libkeccak_hmac_state_t *\fIsrc\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -39,6 +36,3 @@ function may fail for any specified for the function .SH SEE ALSO .BR libkeccak_hmac_duplicate (3), .BR libkeccak_hmac_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_create.3 b/man3/libkeccak_hmac_create.3 index fcb99cb..91bb8a1 100644 --- a/man3/libkeccak_hmac_create.3 +++ b/man3/libkeccak_hmac_create.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_hmac_create - Allocate and initialise HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -libkeccak_hmac_state_t * -libkeccak_hmac_create(const libkeccak_spec_t *\fIspec\fP, const char *\fIkey\fP, - size_t \fIkey_length\fP); + +libkeccak_hmac_state_t *libkeccak_hmac_create(const libkeccak_spec_t *\fIspec\fP, const void *\fIkey\fP, size_t \fIkey_length\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -48,6 +45,3 @@ and .BR libkeccak_hmac_free (3), .BR libkeccak_hmac_fast_free (3), .BR libkeccak_hmac_duplicate (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_destroy.3 b/man3/libkeccak_hmac_destroy.3 index 2f3bbf8..0038eca 100644 --- a/man3/libkeccak_hmac_destroy.3 +++ b/man3/libkeccak_hmac_destroy.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_hmac_destroy - Destroys an HMAC-hashing state with erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_hmac_destroy(libkeccak_hmac_state_t *\fIstate\fP); + +void libkeccak_hmac_destroy(libkeccak_hmac_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -38,6 +36,3 @@ function cannot fail. .BR libkeccak_hmac_initialise (3), .BR libkeccak_hmac_reset (3), .BR libkeccak_hmac_wipe (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_digest.3 b/man3/libkeccak_hmac_digest.3 index 66d35d4..99e460a 100644 --- a/man3/libkeccak_hmac_digest.3 +++ b/man3/libkeccak_hmac_digest.3 @@ -2,16 +2,13 @@ .SH NAME libkeccak_hmac_digest - Complete the HMAC-hashing of a message with erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_hmac_digest(libkeccak_hmac_state_t *\fIstate\fP, const char *\fImsg\fP, - size_t \fImsglen\fP, size_t \fIbits\fP, const char *\fIsuffix\fP, - char *\fIhashsum\fP); + +int libkeccak_hmac_digest(libkeccak_hmac_state_t *\fIstate\fP, const void *\fImsg\fP, size_t \fImsglen\fP, + size_t \fIbits\fP, const char *\fIsuffix\fP, void *\fIhashsum\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -54,7 +51,7 @@ to the message. If this string is empty, may be used instead. This is used to select hash algorithm. For pure Keccak, .I NULL -or "" is used. For the other algorithms the constants +or \(dq\(dq is used. For the other algorithms the constants .B LIBKECCAK_SHA3_SUFFIX (for SHA-3), .B LIBKECCAK_RAWSHAKE_SUFFIX @@ -98,6 +95,3 @@ function may fail for any reason specified by the function .BR libkeccak_hmac_initialise (3), .BR libkeccak_hmac_update (3), .BR libkeccak_hmac_fast_digest (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_duplicate.3 b/man3/libkeccak_hmac_duplicate.3 index 70c994c..bb16139 100644 --- a/man3/libkeccak_hmac_duplicate.3 +++ b/man3/libkeccak_hmac_duplicate.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_hmac_duplicate - Allocate a duplicate an HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -libkeccak_hmac_state_t * -libkeccak_hmac_duplicate(const libkeccak_hmac_state_t *\fIsrc\fP); + +libkeccak_hmac_state_t *libkeccak_hmac_duplicate(const libkeccak_hmac_state_t *\fIsrc\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -41,6 +39,3 @@ function may fail for any specified for the function .SH SEE ALSO .BR libkeccak_hmac_copy (3), .BR libkeccak_hmac_create (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_fast_destroy.3 b/man3/libkeccak_hmac_fast_destroy.3 index d2af66e..31bf894 100644 --- a/man3/libkeccak_hmac_fast_destroy.3 +++ b/man3/libkeccak_hmac_fast_destroy.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_hmac_fast_destroy - Destroys an HMAC-hashing state without erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_hamc_fast_destroy(libkeccak_hmac_state_t *\fIstate\fP); + +void libkeccak_hamc_fast_destroy(libkeccak_hmac_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -38,6 +36,3 @@ function cannot fail. .BR libkeccak_hmac_initialise (3), .BR libkeccak_hmac_reset (3), .BR libkeccak_hmac_wipe (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_fast_digest.3 b/man3/libkeccak_hmac_fast_digest.3 index 008477c..68fcc69 100644 --- a/man3/libkeccak_hmac_fast_digest.3 +++ b/man3/libkeccak_hmac_fast_digest.3 @@ -2,16 +2,13 @@ .SH NAME libkeccak_hmac_fast_digest - Complete the HMAC-hashing of a message without erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_hmac_fast_digest(libkeccak_hmac_state_t *\fIstate\fP, - const char *\fImsg\fP, size_t \fImsglen\fP, size_t \fIbits\fP, - const char *\fIsuffix\fP, char *\fIhashsum\fP); + +int libkeccak_hmac_fast_digest(libkeccak_hmac_state_t *\fIstate\fP, const void *\fImsg\fP, size_t \fImsglen\fP, + size_t \fIbits\fP, const char *\fIsuffix\fP, void *\fIhashsum\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -54,7 +51,7 @@ to the message. If this string is empty, may be used instead. This is used to select hash algorithm. For pure Keccak, .I NULL -or "" is used. For the other algorithms the constants +or \(dq\(dq is used. For the other algorithms the constants .B LIBKECCAK_SHA3_SUFFIX (for SHA-3), .B LIBKECCAK_RAWSHAKE_SUFFIX @@ -99,6 +96,3 @@ function may fail for any reason specified by the function .BR libkeccak_hmac_initialise (3), .BR libkeccak_hmac_fast_update (3), .BR libkeccak_hmac_fast_digest (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_fast_free.3 b/man3/libkeccak_hmac_fast_free.3 index b4817ce..f888872 100644 --- a/man3/libkeccak_hmac_fast_free.3 +++ b/man3/libkeccak_hmac_fast_free.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_hmac_fast_free - Destroys and deallocates an HMAC-hashing state without erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_hmac_fast_free(libkeccak_hmac_state_t *\fIstate\fP); + +void libkeccak_hmac_fast_free(libkeccak_hmac_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -46,6 +44,3 @@ to be freed, resulting in undefined behaviour. .BR libkeccak_hmac_initialise (3), .BR libkeccak_hmac_reset (3), .BR libkeccak_hmac_wipe (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_fast_update.3 b/man3/libkeccak_hmac_fast_update.3 index 43077d3..a41b72f 100644 --- a/man3/libkeccak_hmac_fast_update.3 +++ b/man3/libkeccak_hmac_fast_update.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_hmac_fast_update - Partially HMAC-hash a message without erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_hmac_fast_update(libkeccak_state_t *\fIstate\fP, const char *\fImsg\fP, - size_t \fImsglen\fP); + +int libkeccak_hmac_fast_update(libkeccak_state_t *\fIstate\fP, const void *\fImsg\fP, size_t \fImsglen\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -54,6 +51,3 @@ or 0. .BR libkeccak_hmac_initialise (3), .BR libkeccak_hmac_fast_digest (3), .BR libkeccak_hmac_update (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_free.3 b/man3/libkeccak_hmac_free.3 index d1f9c84..c70f369 100644 --- a/man3/libkeccak_hmac_free.3 +++ b/man3/libkeccak_hmac_free.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_hmac_free - Destroys and deallocates an HMAC-hashing state with erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_hmac_free(libkeccak_hmac_state_t *\fIstate\fP); + +void libkeccak_hmac_free(libkeccak_hmac_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -46,6 +44,3 @@ to be freed, resulting in undefined behaviour. .BR libkeccak_hmac_initialise (3), .BR libkeccak_hmac_reset (3), .BR libkeccak_hmac_wipe (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_initialise.3 b/man3/libkeccak_hmac_initialise.3 index de514e9..17b2b9f 100644 --- a/man3/libkeccak_hmac_initialise.3 +++ b/man3/libkeccak_hmac_initialise.3 @@ -2,16 +2,13 @@ .SH NAME libkeccak_hmac_initialise - Initialise HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_hmac_initialise(libkeccak_hmac_state_t *\fIstate\fP, - const libkeccak_spec_t *\fIspec\fP, - const char *\fIkey\fP, size_t \fIkey_length\fP); + +int libkeccak_hmac_initialise(libkeccak_hmac_state_t *\fIstate\fP, const libkeccak_spec_t *\fIspec\fP, + const void *\fIkey\fP, size_t \fIkey_length\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -52,6 +49,3 @@ and .BR libkeccak_spec_check (3), .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_marshal.3 b/man3/libkeccak_hmac_marshal.3 index b7270f6..2e31dd7 100644 --- a/man3/libkeccak_hmac_marshal.3 +++ b/man3/libkeccak_hmac_marshal.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_hmac_marshal - Marshals an HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -size_t -libkeccak_hmac_marshal(const libkeccak_hmac_state_t *\fIstate\fP, - char *\fIdata\fP); + +size_t libkeccak_hmac_marshal(const libkeccak_hmac_state_t *\fIstate\fP, void *\fIdata\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -39,6 +36,3 @@ function cannot fail. .BR libkeccak_hmac_marshal_size (3), .BR libkeccak_hmac_unmarshal (3), .BR libkeccak_hmac_unmarshal_skip (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_marshal_size.3 b/man3/libkeccak_hmac_marshal_size.3 index 5195b81..fe8ec2f 100644 --- a/man3/libkeccak_hmac_marshal_size.3 +++ b/man3/libkeccak_hmac_marshal_size.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_hmac_marshal_size - Calculates the marshal-size of an HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -size_t -libkeccak_hmac_marshal_size(const libkeccak_hmac_state_t *\fIstate\fP); + +size_t libkeccak_hmac_marshal_size(const libkeccak_hmac_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -31,6 +29,3 @@ function cannot fail. .BR libkeccak_hmac_marshal (3), .BR libkeccak_hmac_unmarshal (3), .BR libkeccak_hmac_unmarshal_skip (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_reset.3 b/man3/libkeccak_hmac_reset.3 index d5634d9..4a9aadf 100644 --- a/man3/libkeccak_hmac_reset.3 +++ b/man3/libkeccak_hmac_reset.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_hmac_reset - Reinitialise a HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_hmac_reset(libkeccak_hmac_state_t *\fIstate\fP, const char *\fIkey\fP, - size_t \fIkey_length\fP); + +int libkeccak_hmac_reset(libkeccak_hmac_state_t *\fIstate\fP, const void *\fIkey\fP, size_t \fIkey_length\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -46,6 +43,3 @@ and .BR libkeccak_hmac_free (3), .BR libkeccak_hmac_fast_destroy (3), .BR libkeccak_hmac_destroy (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_set_key.3 b/man3/libkeccak_hmac_set_key.3 index 2f4682d..ea8084e 100644 --- a/man3/libkeccak_hmac_set_key.3 +++ b/man3/libkeccak_hmac_set_key.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_hmac_set_key - Changes key for a the HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_hmac_set_key(libkeccak_hmac_state_t *\fIstate\fP, const char *\fIkey\fP, - size_t \fIkey_length\fP); + +int libkeccak_hmac_set_key(libkeccak_hmac_state_t *\fIstate\fP, const void *\fIkey\fP, size_t \fIkey_length\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -36,6 +33,3 @@ function may fail for any specified for the function .BR libkeccak_hmac_create (3), .BR libkeccak_hmac_initialise (3), .BR libkeccak_hmac_reset (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_unmarshal.3 b/man3/libkeccak_hmac_unmarshal.3 index 64e8f24..c3ed187 100644 --- a/man3/libkeccak_hmac_unmarshal.3 +++ b/man3/libkeccak_hmac_unmarshal.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_hmac_unmarshal - Unharshals an HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -size_t -libkeccak_hmac_unmarshal(libkeccak_hmac_state_t *\fIstate\fP, - const char *\fIdata\fP); + +size_t libkeccak_hmac_unmarshal(libkeccak_hmac_state_t *\fIstate\fP, const void *\fIdata\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -24,7 +21,7 @@ and stores it in The .BR libkeccak_hmac_unmarshal () returns the number of bytes reads from -.IR data x. +.IR data . .SH ERRORS The .BR libkeccak_hmac_unmarshal () @@ -34,6 +31,3 @@ function may fail for any specified for the function .BR libkeccak_hmac_marshal_size (3), .BR libkeccak_hmac_marshal (3), .BR libkeccak_hmac_unmarshal_skip (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_unmarshal_skip.3 b/man3/libkeccak_hmac_unmarshal_skip.3 index 30e7ccf..25db1ba 100644 --- a/man3/libkeccak_hmac_unmarshal_skip.3 +++ b/man3/libkeccak_hmac_unmarshal_skip.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_hmac_unmarshal_skip - Calculates the marshal-size of a marshalled HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -size_t -libkeccak_hmac_unmarshal_skip(const char *\fIdata\fP); + +size_t libkeccak_hmac_unmarshal_skip(const void *\fIdata\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -35,6 +33,3 @@ function cannot fail. .BR libkeccak_hmac_marshal_size (3), .BR libkeccak_hmac_marshal (3), .BR libkeccak_hmac_unmarshal (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_update.3 b/man3/libkeccak_hmac_update.3 index daaf3fb..13891cb 100644 --- a/man3/libkeccak_hmac_update.3 +++ b/man3/libkeccak_hmac_update.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_hmac_update - Partially HMAC-hash a message with erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_hmac_update(libkeccak_state_t *\fIstate\fP, const char *\fImsg\fP, - size_t \fImsglen\fP); + +int libkeccak_hmac_update(libkeccak_state_t *\fIstate\fP, const void *\fImsg\fP, size_t \fImsglen\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -51,6 +48,3 @@ or 0. .BR libkeccak_hmac_initialise (3), .BR libkeccak_hmac_digest (3), .BR libkeccak_hmac_fast_update (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_hmac_wipe.3 b/man3/libkeccak_hmac_wipe.3 index bad351b..471a9a8 100644 --- a/man3/libkeccak_hmac_wipe.3 +++ b/man3/libkeccak_hmac_wipe.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_hmac_wipe - Securely erase sensitive data from a HMAC-hashing state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_hmac_wipe(libkeccak_hmac_state_t *\fIstate\fP); + +int libkeccak_hmac_wipe(libkeccak_hmac_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -31,6 +29,3 @@ function cannot fail. .BR libkeccak_hmac_free (3), .BR libkeccak_hmac_fast_destroy (3), .BR libkeccak_hmac_destroy (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_keccaksum_fd.3 b/man3/libkeccak_keccaksum_fd.3 index 2fc1b21..ccd1f8a 100644 --- a/man3/libkeccak_keccaksum_fd.3 +++ b/man3/libkeccak_keccaksum_fd.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_keccaksum_fd - Calculate a Keccak hashsum of a file .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_keccaksum_fd(int \fIfd\fP, libkeccak_state_t *\fIstate\fP, - const libkeccak_spec_t *\fIspec\fP, char *\fIhashsum\fP); + +int libkeccak_keccaksum_fd(int \fIfd\fP, libkeccak_state_t *\fIstate\fP, const libkeccak_spec_t *\fIspec\fP, void *\fIhashsum\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -99,9 +96,9 @@ spec.capacity = 576; spec.output = 256; if (libkeccak_keccaksum_fd(STDIN_FILENO, &state, &spec, binhash) < 0) - goto fail; + goto fail; libkeccak_behex_lower(hexhash, binhash, sizeof(binhash)); -printf("%s\\n", hexhash); +printf(\(dq%s\en\(dq, hexhash); libkeccak_state_destroy(&state); .fi .SH SEE ALSO @@ -114,6 +111,3 @@ libkeccak_state_destroy(&state); .BR libkeccak_spec_check (3), .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_rawshakesum_fd.3 b/man3/libkeccak_rawshakesum_fd.3 index 27c4f45..8fad150 100644 --- a/man3/libkeccak_rawshakesum_fd.3 +++ b/man3/libkeccak_rawshakesum_fd.3 @@ -2,16 +2,12 @@ .SH NAME libkeccak_rawshakesum_fd - Calculate a RawSHAKE hashsum of a file .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_rawshakesum_fd(int \fIfd\fP, libkeccak_state_t *\fIstate\fP, - long int \fIsemicapacity\fP, long int \fIoutput\fP, - char *\fIhashsum\fP); + +int libkeccak_rawshakesum_fd(int \fIfd\fP, libkeccak_state_t *\fIstate\fP, long int \fIsemicapacity\fP, long int \fIoutput\fP, void *\fIhashsum\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -94,9 +90,9 @@ from stdin, and prints the hash, in hexadecimal form, to stdout. .nf libkeccak_state_t state; if (libkeccak_rawshakesum_fd(STDIN_FILENO, &state, 256, 512, binhash) < 0) - goto fail; + goto fail; libkeccak_behex_lower(hexhash, binhash, sizeof(binhash)); -printf("%s\\n", hexhash); +printf(\(dq%s\en\(dq, hexhash); libkeccak_state_destroy(&state); .fi .SH SEE ALSO @@ -110,6 +106,3 @@ libkeccak_state_destroy(&state); .BR libkeccak_spec_check (3), .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_sha3sum_fd.3 b/man3/libkeccak_sha3sum_fd.3 index e8c4fc0..0d697e6 100644 --- a/man3/libkeccak_sha3sum_fd.3 +++ b/man3/libkeccak_sha3sum_fd.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_sha3sum_fd - Calculate a SHA-3 hashsum of a file .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_sha3sum_fd(int \fIfd\fP, libkeccak_state_t *\fIstate\fP, long int \fIoutput\fP, - char *\fIhashsum\fP); + +int libkeccak_sha3sum_fd(int \fIfd\fP, libkeccak_state_t *\fIstate\fP, long int \fIoutput\fP, void *\fIhashsum\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -90,9 +87,9 @@ from stdin, and prints the hash, in hexadecimal form, to stdout. .nf libkeccak_state_t state; if (libkeccak_sha3sum_fd(STDIN_FILENO, &state, 256, binhash) < 0) - goto fail; + goto fail; libkeccak_behex_lower(hexhash, binhash, sizeof(binhash)); -printf("%s\\n", hexhash); +printf(\(dq%s\en\(dq, hexhash); libkeccak_state_destroy(&state); .fi .SH SEE ALSO @@ -106,6 +103,3 @@ libkeccak_state_destroy(&state); .BR libkeccak_spec_check (3), .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_shakesum_fd.3 b/man3/libkeccak_shakesum_fd.3 index 0d89f39..441c549 100644 --- a/man3/libkeccak_shakesum_fd.3 +++ b/man3/libkeccak_shakesum_fd.3 @@ -2,16 +2,12 @@ .SH NAME libkeccak_shakesum_fd - Calculate a SHAKE hashsum of a file .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_shakesum_fd(int \fIfd\fP, libkeccak_state_t *\fIstate\fP, - long int \fIsemicapacity\fP, long int \fIoutput\fP, - char *\fIhashsum\fP); + +int libkeccak_shakesum_fd(int \fIfd\fP, libkeccak_state_t *\fIstate\fP, long int \fIsemicapacity\fP, long int \fIoutput\fP, void *\fIhashsum\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -94,9 +90,9 @@ from stdin, and prints the hash, in hexadecimal form, to stdout. .nf libkeccak_state_t state; if (libkeccak_shakesum_fd(STDIN_FILENO, &state, 256, 512, binhash) < 0) - goto fail; + goto fail; libkeccak_behex_lower(hexhash, binhash, sizeof(binhash)); -printf("%s\\n", hexhash); +printf(\(dq%s\en\(dq, hexhash); libkeccak_state_destroy(&state); .fi .SH SEE ALSO @@ -110,6 +106,3 @@ libkeccak_state_destroy(&state); .BR libkeccak_spec_check (3), .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_simple_squeeze.3 b/man3/libkeccak_simple_squeeze.3 index 52605ed..8626f5a 100644 --- a/man3/libkeccak_simple_squeeze.3 +++ b/man3/libkeccak_simple_squeeze.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_simple_squeeze - Runs Keccak-f a number of times .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_simple_squeeze(libkeccak_state_t *\fIstate\fP, long int \fItimes\fP); + +void libkeccak_simple_squeeze(libkeccak_state_t *\fIstate\fP, long int \fItimes\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -33,6 +31,3 @@ function cannot fail. .BR libkeccak_fast_digest (3), .BR libkeccak_fast_squeeze (3), .BR libkeccak_squeeze (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_spec_check.3 b/man3/libkeccak_spec_check.3 index 9fc70f6..7dd19d8 100644 --- a/man3/libkeccak_spec_check.3 +++ b/man3/libkeccak_spec_check.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_spec_check - Validate hashing parameters .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_spec_check(const libkeccak_spec_t *\fIspec\fP); + +int libkeccak_spec_check(const libkeccak_spec_t *\fIspec\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -27,9 +25,9 @@ manually for Keccak hashing. .PP .nf typedef struct libkeccak_spec { - long int bitrate; /* bitrate (in bits) */ - long int capacity; /* capacity (in bits) */ - long int output; /* output size (in bits) */ + long int bitrate; /* bitrate (in bits) */ + long int capacity; /* capacity (in bits) */ + long int output; /* output size (in bits) */ } libkeccak_spec_t; .fi .SH RETURN VALUES @@ -90,6 +88,3 @@ function cannot fail. .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_initialise (3), .BR libkeccak_hmac_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_spec_rawshake.3 b/man3/libkeccak_spec_rawshake.3 index 6f60c36..f5f16b8 100644 --- a/man3/libkeccak_spec_rawshake.3 +++ b/man3/libkeccak_spec_rawshake.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_spec_rawshake - Configure RawSHAKE hashing parameters .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_spec_rawshake(libkeccak_spec_t *\fIspec\fP, long int \fIx\fP, - long int \fId\fP); + +void libkeccak_spec_rawshake(libkeccak_spec_t *\fIspec\fP, long int \fIx\fP, long int \fId\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -36,7 +33,7 @@ function cannot fail. This example configure a .B libkeccak_spec_t to specify the Keccak parameters used for RawSHAKE256(, 512): -.LP +.PP .nf libkeccak_spec_t spec; libkeccak_spec_rawshake(&spec, 256, 512); @@ -48,6 +45,3 @@ libkeccak_spec_rawshake(&spec, 256, 512); .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_initialise (3), .BR libkeccak_hmac_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_spec_sha3.3 b/man3/libkeccak_spec_sha3.3 index 8e07a7d..1320631 100644 --- a/man3/libkeccak_spec_sha3.3 +++ b/man3/libkeccak_spec_sha3.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_spec_sha3 - Configure SHA-3 hashing parameters .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_spec_sha3(libkeccak_spec_t *\fIspec\fP, long int \fIx\fP); + +void libkeccak_spec_sha3(libkeccak_spec_t *\fIspec\fP, long int \fIx\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -34,7 +32,7 @@ function cannot fail. This example configure a .B libkeccak_spec_t to specify the Keccak parameters used for SHA3-256: -.LP +.PP .nf libkeccak_spec_t spec; libkeccak_spec_sha3(&spec, 256); @@ -46,6 +44,3 @@ libkeccak_spec_sha3(&spec, 256); .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_initialise (3), .BR libkeccak_hmac_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_spec_shake.3 b/man3/libkeccak_spec_shake.3 index 9e2d763..4beea49 100644 --- a/man3/libkeccak_spec_shake.3 +++ b/man3/libkeccak_spec_shake.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_spec_shake - Configure SHAKE hashing parameters .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_spec_shake(libkeccak_spec_t *\fIspec\fP, long int \fIx\fP, long int \fId\fP); + +void libkeccak_spec_shake(libkeccak_spec_t *\fIspec\fP, long int \fIx\fP, long int \fId\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -35,7 +33,7 @@ function cannot fail. This example configure a .B libkeccak_spec_t to specify the Keccak parameters used for SHAKE256(, 512): -.LP +.PP .nf libkeccak_spec_t spec; libkeccak_spec_shake(&spec, 256, 512); @@ -47,6 +45,3 @@ libkeccak_spec_shake(&spec, 256, 512); .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_initialise (3), .BR libkeccak_hmac_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_squeeze.3 b/man3/libkeccak_squeeze.3 index c6c8d01..67430a4 100644 --- a/man3/libkeccak_squeeze.3 +++ b/man3/libkeccak_squeeze.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_squeeze - Runs the squeeze phase .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_squeeze(libkeccak_state_t *\fIstate\fP, char *\fIhashsum\fP); + +void libkeccak_squeeze(libkeccak_state_t *\fIstate\fP, void *\fIhashsum\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -43,6 +41,3 @@ function cannot fail. .BR libkeccak_fast_digest (3), .BR libkeccak_simple_squeeze (3), .BR libkeccak_fast_squeeze (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_copy.3 b/man3/libkeccak_state_copy.3 index c9283ca..4bd892c 100644 --- a/man3/libkeccak_state_copy.3 +++ b/man3/libkeccak_state_copy.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_state_copy - Copies hash state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_state_copy(libkeccak_state_t *\fIdest\fP, - const libkeccak_state_t *\fIsrc\fP); + +int libkeccak_state_copy(libkeccak_state_t *\fIdest\fP, const libkeccak_state_t *\fIsrc\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -39,6 +36,3 @@ function may fail for any specified for the function .SH SEE ALSO .BR libkeccak_state_duplicate (3), .BR libkeccak_state_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_create.3 b/man3/libkeccak_state_create.3 index 77880a3..f27e124 100644 --- a/man3/libkeccak_state_create.3 +++ b/man3/libkeccak_state_create.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_create - Allocate and initialise hash state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -libkeccak_state_t * -libkeccak_state_create(const libkeccak_spec_t *\fIspec\fP); + +libkeccak_state_t *libkeccak_state_create(const libkeccak_spec_t *\fIspec\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -41,6 +39,3 @@ function may fail for any specified for the function .BR libkeccak_state_free (3), .BR libkeccak_state_fast_free (3) .BR libkeccak_state_duplicate (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_destroy.3 b/man3/libkeccak_state_destroy.3 index 0a78215..2df1f49 100644 --- a/man3/libkeccak_state_destroy.3 +++ b/man3/libkeccak_state_destroy.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_destroy - Destroys a hash state with erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_state_destroy(libkeccak_state_t *\fIstate\fP); + +void libkeccak_state_destroy(libkeccak_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -38,6 +36,3 @@ function cannot fail. .BR libkeccak_state_initialise (3), .BR libkeccak_state_reset (3), .BR libkeccak_state_wipe (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_duplicate.3 b/man3/libkeccak_state_duplicate.3 index 54c9be3..dfd0612 100644 --- a/man3/libkeccak_state_duplicate.3 +++ b/man3/libkeccak_state_duplicate.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_duplicate - Allocate a duplicate hash state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -libkeccak_state_t * -libkeccak_state_duplicate(const libkeccak_state_t *\fIsrc\fP); + +libkeccak_state_t *libkeccak_state_duplicate(const libkeccak_state_t *\fIsrc\fP); .fi -.P +.PP Link with .IR -lkeccak P. .SH DESCRIPTION @@ -41,6 +39,3 @@ function may fail for any specified for the function .SH SEE ALSO .BR libkeccak_state_copy (3), .BR libkeccak_state_create (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_fast_destroy.3 b/man3/libkeccak_state_fast_destroy.3 index e04ca86..f346611 100644 --- a/man3/libkeccak_state_fast_destroy.3 +++ b/man3/libkeccak_state_fast_destroy.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_fast_destroy - Destroys a hash state without erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_state_fast_destroy(libkeccak_state_t *\fIstate\fP); + +void libkeccak_state_fast_destroy(libkeccak_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -38,6 +36,3 @@ function cannot fail. .BR libkeccak_state_initialise (3), .BR libkeccak_state_reset (3), .BR libkeccak_state_wipe (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_fast_free.3 b/man3/libkeccak_state_fast_free.3 index e617e21..01d0ed8 100644 --- a/man3/libkeccak_state_fast_free.3 +++ b/man3/libkeccak_state_fast_free.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_fast_free - Destroys and deallocates a hash state without erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_state_fast_free(libkeccak_state_t *\fIstate\fP); + +void libkeccak_state_fast_free(libkeccak_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -46,6 +44,3 @@ to be freed, resulting in undefined behaviour. .BR libkeccak_state_initialise (3), .BR libkeccak_state_reset (3), .BR libkeccak_state_wipe (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_free.3 b/man3/libkeccak_state_free.3 index e6dd3f8..8761d54 100644 --- a/man3/libkeccak_state_free.3 +++ b/man3/libkeccak_state_free.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_free - Destroys and deallocates a hash state with erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_state_free(libkeccak_state_t *\fIstate\fP); + +void libkeccak_state_free(libkeccak_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -46,6 +44,3 @@ to be freed, resulting in undefined behaviour. .BR libkeccak_state_initialise (3), .BR libkeccak_state_reset (3), .BR libkeccak_state_wipe (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_initialise.3 b/man3/libkeccak_state_initialise.3 index 2620686..cef4d3d 100644 --- a/man3/libkeccak_state_initialise.3 +++ b/man3/libkeccak_state_initialise.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_state_initialise - Initialise hash state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_state_initialise(libkeccak_state_t *\fIstate\fP, - const libkeccak_spec_t *\fIspec\fP); + +int libkeccak_state_initialise(libkeccak_state_t *\fIstate\fP, const libkeccak_spec_t *\fIspec\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -55,6 +52,3 @@ function may fail for any specified for the function .BR libkeccak_generalised_spec_initialise (3), .BR libkeccak_state_marshal_size (3), .BR libkeccak_hmac_initialise (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_marshal.3 b/man3/libkeccak_state_marshal.3 index f5d5e05..ae21d17 100644 --- a/man3/libkeccak_state_marshal.3 +++ b/man3/libkeccak_state_marshal.3 @@ -2,20 +2,20 @@ .SH NAME libkeccak_state_marshal - Marshals a hash state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -size_t -libkeccak_state_marshal(const libkeccak_state_t *\fIstate\fP, char *\fIdata\fP); + +size_t libkeccak_state_marshal(const libkeccak_state_t *\fIstate\fP, void *\fIdata\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION The .BR libkeccak_state_marshal () -function marshals \fI*state\fP into the beginning of +function marshals +.I *state +into the beginning of .IR data . .PP Use the @@ -36,6 +36,3 @@ function cannot fail. .BR libkeccak_state_marshal_size (3), .BR libkeccak_state_unmarshal (3), .BR libkeccak_state_unmarshal_skip (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_marshal_size.3 b/man3/libkeccak_state_marshal_size.3 index 8ebb16a..9eca42b 100644 --- a/man3/libkeccak_state_marshal_size.3 +++ b/man3/libkeccak_state_marshal_size.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_marshal_size - Calculates the marshal-size of a hash state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -size_t -libkeccak_state_marshal_size(const libkeccak_state_t *\fIstate\fP); + +size_t libkeccak_state_marshal_size(const libkeccak_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -31,6 +29,3 @@ function cannot fail. .BR libkeccak_state_marshal (3), .BR libkeccak_state_unmarshal (3), .BR libkeccak_state_unmarshal_skip (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_reset.3 b/man3/libkeccak_state_reset.3 index 60bb778..566bd6b 100644 --- a/man3/libkeccak_state_reset.3 +++ b/man3/libkeccak_state_reset.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_reset - Reinitialise hash state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_state_reset(libkeccak_state_t *\fIstate\fP); + +void libkeccak_state_reset(libkeccak_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -32,6 +30,3 @@ function cannot fail. .BR libkeccak_state_destroy (3), .BR libkeccak_state_fast_destroy (3), .BR libkeccak_state_wipe (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_unmarshal.3 b/man3/libkeccak_state_unmarshal.3 index 5a9e59b..8643164 100644 --- a/man3/libkeccak_state_unmarshal.3 +++ b/man3/libkeccak_state_unmarshal.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_unmarshal - Unharshals a hash state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -size_t -libkeccak_state_unmarshal(libkeccak_state_t *\fIstate\fP, const char *\fIdata\fP); + +size_t libkeccak_state_unmarshal(libkeccak_state_t *\fIstate\fP, const void *\fIdata\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -34,6 +32,3 @@ function may fail for any specified for the function .BR libkeccak_state_marshal_size (3), .BR libkeccak_state_marshal (3), .BR libkeccak_state_unmarshal_skip (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_unmarshal_skip.3 b/man3/libkeccak_state_unmarshal_skip.3 index b87386c..9fb9336 100644 --- a/man3/libkeccak_state_unmarshal_skip.3 +++ b/man3/libkeccak_state_unmarshal_skip.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_unmarshal_skip - Calculates the marshal-size of a marshalled hash state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -size_t -libkeccak_state_unmarshal_skip(const char *\fIdata\fP); + +size_t libkeccak_state_unmarshal_skip(const void *\fIdata\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -35,6 +33,3 @@ function cannot fail. .BR libkeccak_state_marshal_size (3), .BR libkeccak_state_marshal (3), .BR libkeccak_state_unmarshal (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_wipe.3 b/man3/libkeccak_state_wipe.3 index 664cd51..1ae2759 100644 --- a/man3/libkeccak_state_wipe.3 +++ b/man3/libkeccak_state_wipe.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_wipe - Securely erase sensitive data .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_state_wipe(libkeccak_state_t *\fIstate\fP); + +void libkeccak_state_wipe(libkeccak_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -32,6 +30,3 @@ function cannot fail. .BR libkeccak_state_fast_destroy (3), .BR libkeccak_state_destroy (3), .BR libkeccak_state_reset (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_wipe_message.3 b/man3/libkeccak_state_wipe_message.3 index c734560..7d53afb 100644 --- a/man3/libkeccak_state_wipe_message.3 +++ b/man3/libkeccak_state_wipe_message.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_wipe_message - Securely erase the message chunk buffer .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_state_wipe_message(libkeccak_state_t *\fIstate\fP); + +void libkeccak_state_wipe_message(libkeccak_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -30,6 +28,3 @@ function cannot fail. .BR libkeccak_state_fast_destroy (3), .BR libkeccak_state_destroy (3), .BR libkeccak_state_reset (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_state_wipe_sponge.3 b/man3/libkeccak_state_wipe_sponge.3 index 4651fc0..31d6c66 100644 --- a/man3/libkeccak_state_wipe_sponge.3 +++ b/man3/libkeccak_state_wipe_sponge.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_state_wipe_sponge - Securely erase the Keccak sponge state .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_state_wipe_sponge(libkeccak_state_t *\fIstate\fP); + +void libkeccak_state_wipe_sponge(libkeccak_state_t *\fIstate\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -30,6 +28,3 @@ function cannot fail. .BR libkeccak_state_fast_destroy (3), .BR libkeccak_state_destroy (3), .BR libkeccak_state_reset (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_unhex.3 b/man3/libkeccak_unhex.3 index 93cde63..c7dc9bc 100644 --- a/man3/libkeccak_unhex.3 +++ b/man3/libkeccak_unhex.3 @@ -2,14 +2,12 @@ .SH NAME libkeccak_unhex - Converts a hexadecimal hashsum to binary .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -void -libkeccak_unhex(char *restrict \fIoutput\fP, const char *restrict \fIhashsum\fP); + +void libkeccak_unhex(void *restrict \fIoutput\fP, const char *restrict \fIhashsum\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -48,6 +46,3 @@ must have an even number of digits .SH SEE ALSO .BR libkeccak_behex_lower (3), .BR libkeccak_behex_upper (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se diff --git a/man3/libkeccak_update.3 b/man3/libkeccak_update.3 index d83f74b..4e9f584 100644 --- a/man3/libkeccak_update.3 +++ b/man3/libkeccak_update.3 @@ -2,15 +2,12 @@ .SH NAME libkeccak_update - Partially hash a message with erasure .SH SYNOPSIS -.LP .nf #include <libkeccak.h> -.P -int -libkeccak_update(libkeccak_state_t *\fIstate\fP, const char *\fImsg\fP, - size_t \fImsglen\fP); + +int libkeccak_update(libkeccak_state_t *\fIstate\fP, const void *\fImsg\fP, size_t \fImsglen\fP); .fi -.P +.PP Link with .IR -lkeccak . .SH DESCRIPTION @@ -50,7 +47,7 @@ or 0. This example calculates the Keccak[b = 1024, c = 576, n = 256] hash of the input from stdin, and prints the hash, in hexadecimal form, to stdout. -.LP +.PP .nf libkeccak_state_t state; libkeccak_spec_t spec; @@ -63,26 +60,26 @@ spec.bitrate = 1024; spec.capacity = 576; spec.output = 256; if (libkeccak_state_initialise(&state, &spec) < 0) - goto fail; + goto fail; for (;;) { - len = read(STDIN_FILENO, chunk, sizeof(chunk)); + len = read(STDIN_FILENO, chunk, sizeof(chunk)); - if ((len < 0) && (errno == EINTR)) - continue; - if (len < 0) - goto fail; - if (len == 0) - break; + if ((len < 0) && (errno == EINTR)) + continue; + if (len < 0) + goto fail; + if (len == 0) + break; - if (libkeccak_update(&state, chunk, (size_t)len) < 0) - goto fail; + if (libkeccak_update(&state, chunk, (size_t)len) < 0) + goto fail; } -if (libkeccak_digest(&state, NULL, 0, 0, "", binhash) < 0) - goto fail; +if (libkeccak_digest(&state, NULL, 0, 0, \(dq\(dq, binhash) < 0) + goto fail; libkeccak_behex_lower(hexhash, binhash, sizeof(binhash)); -printf("%s\\n", hexhash); +printf(\(dq%s\en\(dq, hexhash); libkeccak_state_destroy(&state); .fi .SH SEE ALSO @@ -90,6 +87,3 @@ libkeccak_state_destroy(&state); .BR libkeccak_fast_update (3), .BR libkeccak_fast_digest (3), .BR libkeccak_digest (3) -.SH BUGS -Please report bugs to https://github.com/maandree/libkeccak/issues or to -maandree@kth.se |