summaryrefslogtreecommitdiff
path: root/src/sha256.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-08 17:27:59 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-08 17:27:59 +0200
commitfde72e50fc280e583b8aec13b4d4af3bd1d205e5 (patch)
tree82942834b95758bb1b129dee6a9c9d13d7542f00 /src/sha256.c
parent973ae30e7c4f7a1afb385dd3d8eeea178f981445 (diff)
removed unneeded headers; fixed some warnings
Diffstat (limited to 'src/sha256.c')
-rw-r--r--src/sha256.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sha256.c b/src/sha256.c
index 0bb29af..00b7319 100644
--- a/src/sha256.c
+++ b/src/sha256.c
@@ -36,7 +36,7 @@ uint32_t k[64] = {
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2};
-static void sha256_transform(sha256_ctx *ctx, uint8_t *data)
+void sha256_transform(sha256_ctx *ctx, uint8_t *data)
{
uint32_t a, b, c, d, e, f, g, h, i, j, t1, t2, m[64];
@@ -76,7 +76,7 @@ static void sha256_transform(sha256_ctx *ctx, uint8_t *data)
ctx->state[7] += h;
}
-static void sha256_init(sha256_ctx *ctx)
+void sha256_init(sha256_ctx *ctx)
{
ctx->datalen = 0;
ctx->bitlen[0] = 0;
@@ -91,7 +91,7 @@ static void sha256_init(sha256_ctx *ctx)
ctx->state[7] = 0x5be0cd19;
}
-static void sha256_update(sha256_ctx *ctx, uint8_t *data, uint32_t len)
+void sha256_update(sha256_ctx *ctx, uint8_t *data, uint32_t len)
{
uint32_t i;
@@ -106,7 +106,7 @@ static void sha256_update(sha256_ctx *ctx, uint8_t *data, uint32_t len)
}
}
-static void sha256_final(uint8_t *hash, sha256_ctx *ctx)
+void sha256_final(uint8_t *hash, sha256_ctx *ctx)
{
uint32_t i;
@@ -152,7 +152,7 @@ static void sha256_final(uint8_t *hash, sha256_ctx *ctx)
}
}
-extern void sha256_hash(char *hash, const char *data, size_t len)
+void sha256_hash(char *hash, const char *data, size_t len)
{
sha256_ctx ctx;
sha256_init(&ctx);