mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-05-16 15:02:50 +00:00
properly add files
This commit is contained in:
parent
76325bdaa6
commit
3ea7ec8a8c
32 changed files with 8858 additions and 0 deletions
33
ed25519/ed25519-donna/ed25519-hash-custom.h
Normal file
33
ed25519/ed25519-donna/ed25519-hash-custom.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
a custom hash must have a 512bit digest and implement:
|
||||
|
||||
struct ed25519_hash_context;
|
||||
|
||||
void ed25519_hash_init(ed25519_hash_context *ctx);
|
||||
void ed25519_hash_update(ed25519_hash_context *ctx, const uint8_t *in, size_t inlen);
|
||||
void ed25519_hash_final(ed25519_hash_context *ctx, uint8_t *hash);
|
||||
void ed25519_hash(uint8_t *hash, const uint8_t *in, size_t inlen);
|
||||
*/
|
||||
#include <sodium/crypto_hash_sha512.h>
|
||||
|
||||
typedef crypto_hash_sha512_state ed25519_hash_context;
|
||||
|
||||
static inline void ed25519_hash_init(ed25519_hash_context *ctx)
|
||||
{
|
||||
crypto_hash_sha512_init(ctx);
|
||||
}
|
||||
|
||||
static inline void ed25519_hash_update(ed25519_hash_context *ctx, const uint8_t *in, size_t inlen)
|
||||
{
|
||||
crypto_hash_sha512_update(ctx,in,inlen);
|
||||
}
|
||||
|
||||
static inline void ed25519_hash_final(ed25519_hash_context *ctx, uint8_t *hash)
|
||||
{
|
||||
crypto_hash_sha512_final(ctx,hash);
|
||||
}
|
||||
|
||||
static inline void ed25519_hash(uint8_t *hash, const uint8_t *in, size_t inlen)
|
||||
{
|
||||
crypto_hash_sha512(hash,in,inlen);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue