libft_ssl/include/libft_ssl.h
2026-05-05 00:17:52 +02:00

32 lines
624 B
C

#ifndef LIBFT_SSL_H
#define LIBFT_SSL_H
#include <stddef.h>
#include <stdint.h>
#include "md5.h"
#include "sha256.h"
#include "whirlpool.h"
struct digest_algo
{
const char *name;
size_t digest_size;
size_t block_size;
void (*init) (void *ctx);
void (*update)(void *ctx, const uint8_t *data, size_t len);
void (*final) (void *ctx, uint8_t *out);
};
union digest_ctx
{
#define DIGEST_ALGO(lower, ds, bs) struct lower##_ctx lower;
#include "digest_algos.h"
#undef DIGEST_ALGO
};
#define DIGEST_ALGO(lower, ds, bs) extern const struct digest_algo g_##lower;
#include "digest_algos.h"
#undef DIGEST_ALGO
#endif