worked sleep.h
doc sleep.3 needs rename
This commit is contained in:
41
inc/sleep.h
41
inc/sleep.h
@@ -1,9 +1,6 @@
|
||||
// TODO implement SLEEP
|
||||
#ifndef SLEEP_H
|
||||
#define SLEEP_H
|
||||
|
||||
#include "key.h"
|
||||
|
||||
// TODO implement SLEEP
|
||||
/*metadata.key
|
||||
metadata.signatures
|
||||
metadata.bitfield
|
||||
@@ -13,5 +10,39 @@ content.key
|
||||
content.signatures
|
||||
content.bitfield
|
||||
content.tree*/
|
||||
#include "key.h"
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
// test
|
||||
#include <assert.h>
|
||||
|
||||
#endif /* NURSERY_H */
|
||||
#define SLEEP_HEADER_SIZE 32u
|
||||
|
||||
#define SLEEP_ALGO_BLAKE2B "BLAKE2b"
|
||||
#define SLEEP_ALGO_ED25519 "Ed25519"
|
||||
|
||||
typedef struct sleep_header {
|
||||
uint32_t magic_be;
|
||||
uint8_t version;
|
||||
uint16_t entry_size_be;
|
||||
uint8_t algo_len;
|
||||
char algo[24];
|
||||
} sleep_header_t;
|
||||
|
||||
// crypto helpers
|
||||
#ifdef SLEEP_SALT
|
||||
int sleep_gen_ed25519(uint8_t pubkey[32], uint8_t seckey[64]);
|
||||
// sign
|
||||
int sleep_sign_ed25519(const uint8_t *msg, size_t msglen,
|
||||
const uint8_t seckey[64], uint8_t sig_out[64]);
|
||||
// verify
|
||||
int sleep_verify_ed25519(const uint8_t *msg, size_t msglen,
|
||||
const uint8_t pubkey[32], const uint8_t sig[64]);
|
||||
// discovery
|
||||
int sleep_compute_discovery_key(const uint8_t pubkey[32], uint8_t out32[32]);
|
||||
#endif /* SLEEP_SALT */
|
||||
|
||||
// function decs
|
||||
|
||||
|
||||
#endif /* SLEEP_H */
|
||||
|
||||
Reference in New Issue
Block a user