feat: add libft ssl skel
This commit is contained in:
parent
bf43c7a124
commit
f21811b66f
2 changed files with 36 additions and 6 deletions
|
|
@ -1,6 +1,21 @@
|
||||||
#ifndef LIBFT_SSL_H
|
#ifndef LIBFT_SSL_H
|
||||||
#define LIBFT_SSL_H
|
#define LIBFT_SSL_H
|
||||||
|
|
||||||
int do_nothing(void);
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
struct digest_algo
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
size_t digest_size;
|
||||||
|
size_t block_size;
|
||||||
|
size_t ctx_size;
|
||||||
|
void (*init) (void *ctx);
|
||||||
|
void (*update)(void *ctx, const uint8_t *data, size_t len);
|
||||||
|
void (*final) (void *ctx, uint8_t *out);
|
||||||
|
};
|
||||||
|
|
||||||
|
extern const struct digest_algo g_md5;
|
||||||
|
extern const struct digest_algo g_sha256;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
|
#include "libft_ssl.h"
|
||||||
|
|
||||||
int
|
const struct digest_algo g_md5 = {
|
||||||
do_nothing(void)
|
.name = "md5",
|
||||||
{
|
.digest_size = 16,
|
||||||
return 0;
|
.block_size = 64,
|
||||||
}
|
.ctx_size = 0,
|
||||||
|
.init = NULL,
|
||||||
|
.update = NULL,
|
||||||
|
.final = NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
const struct digest_algo g_sha256 = {
|
||||||
|
.name = "sha256",
|
||||||
|
.digest_size = 32,
|
||||||
|
.block_size = 64,
|
||||||
|
.ctx_size = 0,
|
||||||
|
.init = NULL,
|
||||||
|
.update = NULL,
|
||||||
|
.final = NULL,
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue