diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-02-05 05:58:49 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-02-05 05:58:49 +0100 |
commit | d63a415efc2d72069fa6da83408f2713825d5406 (patch) | |
tree | 354c1df789cbe8ae1e32c53d86d7c127c459556b /c/sha3.h | |
parent | add note on why versions are not being tagged (diff) | |
download | sha3sum-d63a415efc2d72069fa6da83408f2713825d5406.tar.gz sha3sum-d63a415efc2d72069fa6da83408f2713825d5406.tar.bz2 sha3sum-d63a415efc2d72069fa6da83408f2713825d5406.tar.xz |
misc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'c/sha3.h')
-rw-r--r-- | c/sha3.h | 25 |
1 files changed, 22 insertions, 3 deletions
@@ -19,6 +19,25 @@ #include <stdlib.h> +#ifdef WITH_C99 + #include <inttypes.h> + #define byte int_fast8_t + #define boolean int_fast8_t + #define llong int_fast64_t + #define ullong uint_fast64_t +#else + #define restrict /* introduced in C99 */ + #define byte char + #define boolean char + #if __x86_64__ || __ppc64__ + #define llong long int + #else + #define llong long long int + #endif + #define ullong unsigned llong +#endif + + /** * Initialise Keccak sponge @@ -42,7 +61,7 @@ extern void dispose(void); * @param msg The partial message * @param msglen The length of the partial message */ -extern void update(char* msg, long msglen); +extern void update(byte* restrict msg, long msglen); /** @@ -53,7 +72,7 @@ extern void update(char* msg, long msglen); * @param withReturn Whether to return the hash instead of just do a quick squeeze phrase and return {@code null} * @return The hash sum, or {@code null} if <tt>withReturn</tt> is {@code false} */ -extern char* digest(char* msg, long msglen, long withReturn); +extern byte* digest(byte* restrict msg, long msglen, boolean withReturn); /** @@ -77,5 +96,5 @@ extern void fastSqueeze(long times); * * @return The hash sum */ -extern char* squeeze(void); +extern byte* squeeze(void); |