diff --git a/hash_sha224_sha256.c b/hash_sha224_sha256.c index c4da1b6..7fe36b0 100644 --- a/hash_sha224_sha256.c +++ b/hash_sha224_sha256.c @@ -18,9 +18,7 @@ #include "lilcrypto.h" #include "hash.h" -#include "hash_sha224_sha256.h" #include "impl_sha256.h" - #include "util.h" @@ -55,7 +53,7 @@ #define SHA256_H0_7 UINT32_C(0x5be0cd19) -int +static int sha224_init(void *arg) { struct sha256_ctx *ctx = arg; @@ -79,7 +77,7 @@ sha224_init(void *arg) return 1; } -int +static int sha256_init(void *arg) { struct sha256_ctx *ctx = arg; @@ -143,13 +141,13 @@ sha224_sha256_update(void *arg, const uint8_t *in, size_t inlen) return 1; } -int +static int sha224_update(void *arg, const uint8_t *in, size_t inlen) { return sha224_sha256_update(arg, in, inlen); } -int +static int sha256_update(void *arg, const uint8_t *in, size_t inlen) { return sha224_sha256_update(arg, in, inlen); @@ -176,7 +174,7 @@ sha224_sha256_final(struct sha256_ctx *ctx) sha256_block(ctx); } -int +static int sha224_final(void *arg, uint8_t *out, size_t *outlen) { struct sha256_ctx *ctx = arg; @@ -199,7 +197,7 @@ sha224_final(void *arg, uint8_t *out, size_t *outlen) return 1; } -int +static int sha256_final(void *arg, uint8_t *out, size_t *outlen) { struct sha256_ctx *ctx = arg; diff --git a/hash_sha224_sha256.h b/hash_sha224_sha256.h deleted file mode 100644 index 57ac424..0000000 --- a/hash_sha224_sha256.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2024 Lucas Gabriel Vuotto - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include - - -int sha224_init(void *); -int sha224_update(void *, const uint8_t *, size_t); -int sha224_final(void *, uint8_t *, size_t *); - -int sha256_init(void *); -int sha256_update(void *, const uint8_t *, size_t); -int sha256_final(void *, uint8_t *, size_t *); diff --git a/hash_sha384_sha512.c b/hash_sha384_sha512.c index e8e7467..274b756 100644 --- a/hash_sha384_sha512.c +++ b/hash_sha384_sha512.c @@ -18,9 +18,7 @@ #include "lilcrypto.h" #include "hash.h" -#include "hash_sha384_sha512.h" #include "impl_sha512.h" - #include "util.h" @@ -56,7 +54,7 @@ #define SHA512_H0_7 UINT64_C(0x5be0cd19137e2179) -int +static int sha384_init(void *arg) { struct sha512_ctx *ctx = arg; @@ -80,7 +78,7 @@ sha384_init(void *arg) return 1; } -int +static int sha512_init(void *arg) { struct sha512_ctx *ctx = arg; @@ -148,13 +146,13 @@ sha384_sha512_update(void *arg, const uint8_t *in, size_t inlen) return 1; } -int +static int sha384_update(void *arg, const uint8_t *in, size_t inlen) { return sha384_sha512_update(arg, in, inlen); } -int +static int sha512_update(void *arg, const uint8_t *in, size_t inlen) { return sha384_sha512_update(arg, in, inlen); @@ -182,7 +180,7 @@ sha384_sha512_final(struct sha512_ctx *ctx) sha512_block(ctx); } -int +static int sha384_final(void *arg, uint8_t *out, size_t *outlen) { struct sha512_ctx *ctx = arg; @@ -204,7 +202,7 @@ sha384_final(void *arg, uint8_t *out, size_t *outlen) return 1; } -int +static int sha512_final(void *arg, uint8_t *out, size_t *outlen) { struct sha512_ctx *ctx = arg; diff --git a/hash_sha384_sha512.h b/hash_sha384_sha512.h deleted file mode 100644 index bc27323..0000000 --- a/hash_sha384_sha512.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2024 Lucas Gabriel Vuotto - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include - - -int sha384_init(void *); -int sha384_update(void *, const uint8_t *, size_t); -int sha384_final(void *, uint8_t *, size_t *); - -int sha512_init(void *); -int sha512_update(void *, const uint8_t *, size_t); -int sha512_final(void *, uint8_t *, size_t *);