23 lines
1.1 KiB
C
23 lines
1.1 KiB
C
#ifndef SLEEP_CRYPTO_H
|
|
#define SLEEP_CRYPTO_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include "keys.h"
|
|
//#include "sleep.h"
|
|
int sleep_gen_keypair(sleep_keypair_t *kp);
|
|
int sleep_save_pubkey(const char *path, const uint8_t pubkey[SLEEP_PUBLIC_KEY_BYTES]);
|
|
int sleep_load_pubkey(const char *path, uint8_t pubkey[SLEEP_PUBLIC_KEY_BYTES]);
|
|
|
|
int sleep_blake2b(uint8_t out[SLEEP_BLAKE2B_BYTES], const uint8_t *in, size_t inlen);
|
|
|
|
int sleep_sign(uint8_t sig[SLEEP_BLAKE2B_BYTES], const uint8_t *msg, size_t msglen, const sleep_keypair_t *kp);
|
|
|
|
int sleep_verify(const uint8_t sig[SLEEP_SIGNATURE_BYTES], const uint8_t *msg, size_t msglen, const uint8_t pubkey[SLEEP_PUBLIC_KEY_BYTES]);
|
|
|
|
int sleep_sign_roots(uint8_t sig[SLEEP_SIGNATURE_BYTES], const uint8_t *roots, size_t nroots, const uint64_t *indices, const uint64_t *lengths, const sleep_keypair_t *kp);
|
|
|
|
int sleep_verify_roots(const uint8_t sig[SLEEP_SIGNATURE_BYTES], const uint8_t *roots, size_t nroots, const uint64_t *indices, const uint64_t *lengths, const uint8_t pub[SLEEP_PUBLIC_KEY_BYTES]);
|
|
|
|
#endif /* SLEEP_CRYPTO_H */
|