mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-15 15:16:53 +02:00
Use libmd hashing function implementations instead of embedding our own
This splits the implementation responsibilities, and reduces embedded code copies, which was one of the driving points with this project to start with, so it's nice to give a good example.
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
#include <string.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "hash/sha512.h"
|
||||
#include <sha512.h>
|
||||
|
||||
#include <libperfstat.h>
|
||||
|
||||
@@ -54,9 +54,9 @@
|
||||
HD(b); \
|
||||
} while (0)
|
||||
|
||||
#define HR(x, l) (SHA512_Update(&ctx, (char *)(x), (l)))
|
||||
#define HD(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (x)))
|
||||
#define HF(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (void*)))
|
||||
#define HR(x, l) (SHA512_Update(&ctx, (uint8_t *)(x), (l)))
|
||||
#define HD(x) (SHA512_Update(&ctx, (uint8_t *)&(x), sizeof (x)))
|
||||
#define HF(x) (SHA512_Update(&ctx, (uint8_t *)&(x), sizeof (void*)))
|
||||
|
||||
int getentropy(void *buf, size_t len);
|
||||
|
||||
|
Reference in New Issue
Block a user