diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-01-21 15:46:20 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-01-21 15:46:20 +0000 |
commit | 2746b131aa482ac17c94bc6b82e58dbcc1b752cf (patch) | |
tree | 87e50c57bc8458b0809c280ab5d00042d1102925 /src/librandom/surf.c | |
parent | 05db4ba46ae1ca6143bb9b432d1e05e69eddd263 (diff) | |
download | skalibs-2746b131aa482ac17c94bc6b82e58dbcc1b752cf.tar.xz |
Types fix: librandom, libstdcrypto
Diffstat (limited to 'src/librandom/surf.c')
-rw-r--r-- | src/librandom/surf.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/librandom/surf.c b/src/librandom/surf.c index ad0aab1..fe5346e 100644 --- a/src/librandom/surf.c +++ b/src/librandom/surf.c @@ -1,5 +1,7 @@ /* ISC license. */ +#include <sys/types.h> +#include <stdint.h> #include <skalibs/uint32.h> #include <skalibs/bytestr.h> #include <skalibs/surf.h> @@ -9,10 +11,10 @@ static void surfit (SURFSchedule *ctx) { - uint32 t[12] ; - uint32 z[8] ; - uint32 x ; - uint32 sum = 0 ; + uint32_t t[12] ; + uint32_t z[8] ; + uint32_t x ; + uint32_t sum = 0 ; unsigned int i = 0, loop = 0 ; ; if (!++ctx->in[0] && !++ctx->in[1] && !++ctx->in[2]) ++ctx->in[3] ; @@ -33,10 +35,10 @@ static void surfit (SURFSchedule *ctx) for (i = 0 ; i < 8 ; i++) uint32_pack(ctx->out + (i<<2), z[i]) ; } -void surf (SURFSchedule *ctx, char *s, unsigned int n) +void surf (SURFSchedule *ctx, char *s, size_t n) { { - register unsigned int i = 32 - ctx->pos ; + register size_t i = 32 - ctx->pos ; if (n < i) i = n ; byte_copy(s, i, ctx->out + ctx->pos) ; s += i ; n -= i ; ctx->pos += i ; |