vendor/libhydrogen/hydrogen.h in dualcone-0.0.1 vs vendor/libhydrogen/hydrogen.h in dualcone-1.0.0

- old
+ new

@@ -15,16 +15,16 @@ #if defined(__clang__) || defined(__GNUC__) #define _hydro_attr_(X) __attribute__(X) #else #define _hydro_attr_(X) #endif -#define _hydro_attr_deprecated_ _hydro_attr_((deprecated)) -#define _hydro_attr_malloc_ _hydro_attr_((malloc)) -#define _hydro_attr_noinline_ _hydro_attr_((noinline)) -#define _hydro_attr_noreturn_ _hydro_attr_((noreturn)) +#define _hydro_attr_deprecated_ _hydro_attr_((deprecated)) +#define _hydro_attr_malloc_ _hydro_attr_((malloc)) +#define _hydro_attr_noinline_ _hydro_attr_((noinline)) +#define _hydro_attr_noreturn_ _hydro_attr_((noreturn)) #define _hydro_attr_warn_unused_result_ _hydro_attr_((warn_unused_result)) -#define _hydro_attr_weak_ _hydro_attr_((weak)) +#define _hydro_attr_weak_ _hydro_attr_((weak)) #if defined(__INTEL_COMPILER) || defined(_MSC_VER) #define _hydro_attr_aligned_(X) __declspec(align(X)) #elif defined(__clang__) || defined(__GNUC__) #define _hydro_attr_aligned_(X) _hydro_attr_((aligned(X))) @@ -54,15 +54,15 @@ void hydro_random_reseed(void); /* ---------------- */ -#define hydro_hash_BYTES 32 -#define hydro_hash_BYTES_MAX 65535 -#define hydro_hash_BYTES_MIN 16 +#define hydro_hash_BYTES 32 +#define hydro_hash_BYTES_MAX 65535 +#define hydro_hash_BYTES_MIN 16 #define hydro_hash_CONTEXTBYTES 8 -#define hydro_hash_KEYBYTES 32 +#define hydro_hash_KEYBYTES 32 typedef struct hydro_hash_state { uint32_t state[12]; uint8_t buf_off; uint8_t align[3]; @@ -82,13 +82,13 @@ const uint8_t key[hydro_hash_KEYBYTES]); /* ---------------- */ #define hydro_secretbox_CONTEXTBYTES 8 -#define hydro_secretbox_HEADERBYTES (20 + 16) -#define hydro_secretbox_KEYBYTES 32 -#define hydro_secretbox_PROBEBYTES 16 +#define hydro_secretbox_HEADERBYTES (20 + 16) +#define hydro_secretbox_KEYBYTES 32 +#define hydro_secretbox_PROBEBYTES 16 void hydro_secretbox_keygen(uint8_t key[hydro_secretbox_KEYBYTES]); int hydro_secretbox_encrypt(uint8_t *c, const void *m_, size_t mlen, uint64_t msg_id, const char ctx[hydro_secretbox_CONTEXTBYTES], @@ -109,27 +109,27 @@ _hydro_attr_warn_unused_result_; /* ---------------- */ #define hydro_kdf_CONTEXTBYTES 8 -#define hydro_kdf_KEYBYTES 32 -#define hydro_kdf_BYTES_MAX 65535 -#define hydro_kdf_BYTES_MIN 16 +#define hydro_kdf_KEYBYTES 32 +#define hydro_kdf_BYTES_MAX 65535 +#define hydro_kdf_BYTES_MIN 16 void hydro_kdf_keygen(uint8_t key[hydro_kdf_KEYBYTES]); int hydro_kdf_derive_from_key(uint8_t *subkey, size_t subkey_len, uint64_t subkey_id, const char ctx[hydro_kdf_CONTEXTBYTES], const uint8_t key[hydro_kdf_KEYBYTES]); /* ---------------- */ -#define hydro_sign_BYTES 64 -#define hydro_sign_CONTEXTBYTES 8 +#define hydro_sign_BYTES 64 +#define hydro_sign_CONTEXTBYTES 8 #define hydro_sign_PUBLICKEYBYTES 32 #define hydro_sign_SECRETKEYBYTES 64 -#define hydro_sign_SEEDBYTES 32 +#define hydro_sign_SEEDBYTES 32 typedef struct hydro_sign_state { hydro_hash_state hash_st; } hydro_sign_state; @@ -163,14 +163,14 @@ const uint8_t pk[hydro_sign_PUBLICKEYBYTES]) _hydro_attr_warn_unused_result_; /* ---------------- */ #define hydro_kx_SESSIONKEYBYTES 32 -#define hydro_kx_PUBLICKEYBYTES 32 -#define hydro_kx_SECRETKEYBYTES 32 -#define hydro_kx_PSKBYTES 32 -#define hydro_kx_SEEDBYTES 32 +#define hydro_kx_PUBLICKEYBYTES 32 +#define hydro_kx_SECRETKEYBYTES 32 +#define hydro_kx_PSKBYTES 32 +#define hydro_kx_SEEDBYTES 32 typedef struct hydro_kx_keypair { uint8_t pk[hydro_kx_PUBLICKEYBYTES]; uint8_t sk[hydro_kx_SECRETKEYBYTES]; } hydro_kx_keypair; @@ -259,12 +259,12 @@ int hydro_kx_nk_3(hydro_kx_state *state, hydro_kx_session_keypair *kp, const uint8_t packet2[hydro_kx_NK_PACKET2BYTES]); /* ---------------- */ -#define hydro_pwhash_CONTEXTBYTES 8 +#define hydro_pwhash_CONTEXTBYTES 8 #define hydro_pwhash_MASTERKEYBYTES 32 -#define hydro_pwhash_STOREDBYTES 128 +#define hydro_pwhash_STOREDBYTES 128 void hydro_pwhash_keygen(uint8_t master_key[hydro_pwhash_MASTERKEYBYTES]); int hydro_pwhash_deterministic(uint8_t *h, size_t h_len, const char *passwd, size_t passwd_len, const char ctx[hydro_pwhash_CONTEXTBYTES],