summaryrefslogtreecommitdiff
path: root/src/libstdcrypto/sha512_update.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-02-21 12:05:07 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-02-21 12:05:07 +0000
commit49d8fa1058aaf23c29e074b2314492ae40d2f557 (patch)
tree393f884d5a99f984e992a0f35f1b02ac43536217 /src/libstdcrypto/sha512_update.c
parentfdffefb8032922ce7ffe4c00816072a8ff2148fc (diff)
downloadskalibs-49d8fa1058aaf23c29e074b2314492ae40d2f557.tar.xz
Types change: big pass on libstddjb and libunixonacid
libdatastruct still missing, library still not functional
Diffstat (limited to 'src/libstdcrypto/sha512_update.c')
-rw-r--r--src/libstdcrypto/sha512_update.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstdcrypto/sha512_update.c b/src/libstdcrypto/sha512_update.c
index 63bc6fb..a6c004f 100644
--- a/src/libstdcrypto/sha512_update.c
+++ b/src/libstdcrypto/sha512_update.c
@@ -1,17 +1,16 @@
/* ISC license. */
-#include <sys/types.h>
-#include <skalibs/bytestr.h>
+#include <string.h>
#include <skalibs/sha512.h>
#include "sha512-internal.h"
void sha512_update (SHA512Schedule *ctx, char const *buf, size_t len)
{
- register unsigned int pad = ctx->len & 0x7fU ;
+ unsigned int pad = ctx->len & 0x7fU ;
ctx->len += len ;
if (pad && len >= 128 - pad)
{
- byte_copy((char *)ctx->buf + pad, 128 - pad, buf) ;
+ memcpy((char *)ctx->buf + pad, buf, 128 - pad) ;
buf += 128 - pad ; len -= 128 - pad ; pad = 0 ;
sha512_transform(ctx, ctx->buf) ;
}
@@ -21,5 +20,5 @@ void sha512_update (SHA512Schedule *ctx, char const *buf, size_t len)
sha512_transform(ctx, (unsigned char const *)buf) ;
buf += 128 ; len -= 128 ;
}
- byte_copy((char *)ctx->buf + pad, len, buf) ;
+ memcpy((char *)ctx->buf + pad, buf, len) ;
}