meta: rename to fx

This commit is contained in:
2026-03-16 10:35:43 +00:00
parent 84df46489a
commit e9d0e323f0
233 changed files with 12875 additions and 12869 deletions

View File

@@ -1,14 +1,14 @@
// SHA-224. Adapted from LibTomCrypt. This code is Public Domain
#include "hash.h"
#include <blue/core/hash.h>
#include <fx/core/hash.h>
#include <string.h>
extern void z__b_sha2_256_update(
struct b_hash_ctx *md, const void *src, size_t inlen);
extern void z__b_sha2_256_finish(struct b_hash_ctx *md, void *out, size_t max);
extern void z__fx_sha2_256_update(
struct fx_hash_ctx *md, const void *src, size_t inlen);
extern void z__fx_sha2_256_finish(struct fx_hash_ctx *md, void *out, size_t max);
static void sha_init(struct b_hash_ctx *md)
static void sha_init(struct fx_hash_ctx *md)
{
md->ctx_state.sha2_256.curlen = 0;
md->ctx_state.sha2_256.length = 0;
@@ -22,20 +22,20 @@ static void sha_init(struct b_hash_ctx *md)
md->ctx_state.sha2_256.state[7] = 0xbefa4fa4UL;
}
static void sha_update(struct b_hash_ctx *md, const void *in, size_t inlen)
static void sha_update(struct fx_hash_ctx *md, const void *in, size_t inlen)
{
z__b_sha2_256_update(md, in, inlen);
z__fx_sha2_256_update(md, in, inlen);
}
static void sha_finish(struct b_hash_ctx *md, void *out, size_t max)
static void sha_finish(struct fx_hash_ctx *md, void *out, size_t max)
{
unsigned char res[B_DIGEST_LENGTH_SHA2_256];
z__b_sha2_256_finish(md, res, max);
unsigned char res[FX_DIGEST_LENGTH_SHA2_256];
z__fx_sha2_256_finish(md, res, max);
/* truncate the digest to 224 bits */
memcpy(out, res, b_min(size_t, max, B_DIGEST_LENGTH_224));
memcpy(out, res, fx_min(size_t, max, FX_DIGEST_LENGTH_224));
}
struct b_hash_function_ops z__b_sha2_224_ops = {
struct fx_hash_function_ops z__fx_sha2_224_ops = {
.hash_init = sha_init,
.hash_update = sha_update,
.hash_finish = sha_finish,