aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-23 20:42:36 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-23 20:42:36 +0200
commitad5dd4f1ffaa8c859543ebed63836fda830abbe5 (patch)
tree50e4595aaa0c44cccb3c772f372fedb47277b9b5 /src
parentadd deps list (diff)
downloadautopasswd-ad5dd4f1ffaa8c859543ebed63836fda830abbe5.tar.gz
autopasswd-ad5dd4f1ffaa8c859543ebed63836fda830abbe5.tar.bz2
autopasswd-ad5dd4f1ffaa8c859543ebed63836fda830abbe5.tar.xz
add makefile
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/sha3.c24
-rw-r--r--src/sha3.h46
2 files changed, 35 insertions, 35 deletions
diff --git a/src/sha3.c b/src/sha3.c
index c460b5f..ce35f38 100644
--- a/src/sha3.c
+++ b/src/sha3.c
@@ -20,17 +20,17 @@
#ifdef WITH_C99
- #define static_inline static inline
+# define static_inline static inline
#else
- #define static_inline inline
+# define static_inline inline
#endif
#ifdef WITH_THREADLOCAL
- #define threadlocal __thread
+# define threadlocal __thread
/* This is compiler dependent, if your compiler does
* not support this you need to define __thread yourself. */
#else
- #define threadlocal /* no threading support */
+# define threadlocal /* no threading support */
#endif
#define null 0
@@ -520,7 +520,7 @@ static_inline byte* sha3_pad10star1(byte* restrict_ msg, long len, long r, long*
* @param capacity The capacity
* @param output The output size
*/
-extern void sha3_initialise(long bitrate, long capacity, long output)
+void sha3_initialise(long bitrate, long capacity, long output)
{
long i;
@@ -550,7 +550,7 @@ extern void sha3_initialise(long bitrate, long capacity, long output)
/**
* Dispose of the Keccak sponge
*/
-extern void sha3_dispose()
+void sha3_dispose()
{
#ifdef WITH_WIPE
long i;
@@ -581,7 +581,7 @@ extern void sha3_dispose()
* @param msg The partial message
* @param msglen The length of the partial message
*/
-extern void sha3_update(byte* restrict_ msg, long msglen)
+void sha3_update(byte* restrict_ msg, long msglen)
{
long rr = r >> 3;
long ww = w >> 3;
@@ -659,7 +659,7 @@ extern void sha3_update(byte* restrict_ 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 byte* sha3_digest(byte* restrict_ msg, long msglen, boolean withReturn)
+byte* sha3_digest(byte* restrict_ msg, long msglen, boolean withReturn)
{
byte* message;
byte* _msg;
@@ -777,7 +777,7 @@ extern byte* sha3_digest(byte* restrict_ msg, long msglen, boolean withReturn)
*
* @param times The number of rounds
*/
-extern void sha3_simpleSqueeze(long times)
+void sha3_simpleSqueeze(long times)
{
long i;
for (i = 0; i < times; i++)
@@ -790,7 +790,7 @@ extern void sha3_simpleSqueeze(long times)
*
* @param times The number of digests
*/
-extern void sha3_fastSqueeze(long times)
+void sha3_fastSqueeze(long times)
{
long i, olen;
for (i = 0; i < times; i++)
@@ -808,7 +808,7 @@ extern void sha3_fastSqueeze(long times)
*
* @return The hash sum
*/
-extern byte* sha3_squeeze(void)
+byte* sha3_squeeze(void)
{
long nn, ww, olen, i, j, ptr, ni;
byte* rc;
@@ -852,7 +852,7 @@ extern byte* sha3_squeeze(void)
*
* @return A 25-element array with the state, changes will be applied to the sponge
*/
-extern llong* sha3_state(void)
+llong* sha3_state(void)
{
return S;
}
diff --git a/src/sha3.h b/src/sha3.h
index f984df5..a6cf321 100644
--- a/src/sha3.h
+++ b/src/sha3.h
@@ -23,22 +23,22 @@
#ifdef WITH_C99
- #include <inttypes.h>
- #define restrict_ restrict
- #define byte int_fast8_t
- #define boolean int_fast8_t
- #define llong int_fast64_t
- #define ullong uint_fast64_t
+# include <inttypes.h>
+# define restrict_ restrict
+# 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
+# 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
@@ -50,13 +50,13 @@
* @param capacity The capacity
* @param output The output size
*/
-extern void sha3_initialise(long bitrate, long capacity, long output);
+void sha3_initialise(long bitrate, long capacity, long output);
/**
* Dispose of the Keccak sponge
*/
-extern void sha3_dispose(void);
+void sha3_dispose(void);
/**
@@ -65,7 +65,7 @@ extern void sha3_dispose(void);
* @param msg The partial message
* @param msglen The length of the partial message
*/
-extern void sha3_update(byte* restrict_ msg, long msglen);
+void sha3_update(byte* restrict_ msg, long msglen);
/**
@@ -76,7 +76,7 @@ extern void sha3_update(byte* restrict_ 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 byte* sha3_digest(byte* restrict_ msg, long msglen, boolean withReturn);
+byte* sha3_digest(byte* restrict_ msg, long msglen, boolean withReturn);
/**
@@ -84,7 +84,7 @@ extern byte* sha3_digest(byte* restrict_ msg, long msglen, boolean withReturn);
*
* @param times The number of rounds
*/
-extern void sha3_simpleSqueeze(long times);
+void sha3_simpleSqueeze(long times);
/**
@@ -92,7 +92,7 @@ extern void sha3_simpleSqueeze(long times);
*
* @param times The number of digests
*/
-extern void sha3_fastSqueeze(long times);
+void sha3_fastSqueeze(long times);
/**
@@ -100,7 +100,7 @@ extern void sha3_fastSqueeze(long times);
*
* @return The hash sum
*/
-extern byte* sha3_squeeze(void);
+byte* sha3_squeeze(void);
/**
@@ -108,7 +108,7 @@ extern byte* sha3_squeeze(void);
*
* @return A 25-element array with the state, changes will be applied to the sponge
*/
-extern llong* sha3_state(void);
+llong* sha3_state(void);
#endif