diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-21 12:05:07 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-21 12:05:07 +0000 |
commit | 49d8fa1058aaf23c29e074b2314492ae40d2f557 (patch) | |
tree | 393f884d5a99f984e992a0f35f1b02ac43536217 /src/librandom/surf.c | |
parent | fdffefb8032922ce7ffe4c00816072a8ff2148fc (diff) | |
download | skalibs-49d8fa1058aaf23c29e074b2314492ae40d2f557.tar.xz |
Types change: big pass on libstddjb and libunixonacid
libdatastruct still missing, library still not functional
Diffstat (limited to 'src/librandom/surf.c')
-rw-r--r-- | src/librandom/surf.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/librandom/surf.c b/src/librandom/surf.c index fe5346e..1b68fc2 100644 --- a/src/librandom/surf.c +++ b/src/librandom/surf.c @@ -1,9 +1,8 @@ /* ISC license. */ -#include <sys/types.h> #include <stdint.h> +#include <string.h> #include <skalibs/uint32.h> -#include <skalibs/bytestr.h> #include <skalibs/surf.h> #define ROTATE(x, b) (((x) << (b)) | ((x) >> (32 - (b)))) @@ -38,19 +37,19 @@ static void surfit (SURFSchedule *ctx) void surf (SURFSchedule *ctx, char *s, size_t n) { { - register size_t i = 32 - ctx->pos ; + size_t i = 32 - ctx->pos ; if (n < i) i = n ; - byte_copy(s, i, ctx->out + ctx->pos) ; + memcpy(s, ctx->out + ctx->pos, i) ; s += i ; n -= i ; ctx->pos += i ; } while (n > 32) { surfit(ctx) ; - byte_copy(s, 32, ctx->out) ; + memcpy(s, ctx->out, 32) ; s += 32 ; n -= 32 ; } if (!n) return ; surfit(ctx) ; - byte_copy(s, n, ctx->out) ; + memcpy(s, ctx->out, n) ; ctx->pos = n ; } |