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-384. 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_512_update(
struct b_hash_ctx *md, const void *src, size_t inlen);
extern void z__b_sha2_512_finish(struct b_hash_ctx *md, void *out, size_t max);
extern void z__fx_sha2_512_update(
struct fx_hash_ctx *md, const void *src, size_t inlen);
extern void z__fx_sha2_512_finish(struct fx_hash_ctx *md, void *out, size_t max);
void sha_init(struct b_hash_ctx *md)
void sha_init(struct fx_hash_ctx *md)
{
md->ctx_state.sha2_512.curlen = 0;
md->ctx_state.sha2_512.length = 0;
@@ -22,20 +22,20 @@ void sha_init(struct b_hash_ctx *md)
md->ctx_state.sha2_512.state[7] = 0x47b5481dbefa4fa4ULL;
}
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_512_update(md, in, inlen);
z__fx_sha2_512_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_512];
z__b_sha2_512_finish(md, res, max);
unsigned char res[FX_DIGEST_LENGTH_SHA2_512];
z__fx_sha2_512_finish(md, res, max);
/* truncate the digest to 384 bits */
memcpy(out, res, b_min(size_t, max, B_DIGEST_LENGTH_384));
memcpy(out, res, fx_min(size_t, max, FX_DIGEST_LENGTH_384));
}
struct b_hash_function_ops z__b_sha2_384_ops = {
struct fx_hash_function_ops z__fx_sha2_384_ops = {
.hash_init = sha_init,
.hash_update = sha_update,
.hash_finish = sha_finish,