/* LOCAL TEST SHIM ONLY. The machine has the libsodium 1.0.20 shared library (Nix store) but no * development headers, so this declares just the prototypes main.c uses, copied from the * libsodium 1.0.20 API. On the ESP32 (ESP-IDF libsodium component) and any normal install, * delete this directory and let the real be found instead. */ #ifndef SODIUM_SHIM_H #define SODIUM_SHIM_H #include int sodium_init(void); int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); int crypto_scalarmult(unsigned char *q, const unsigned char *n, const unsigned char *p); #define crypto_sign_PUBLICKEYBYTES 32U #define crypto_sign_SECRETKEYBYTES 64U #define crypto_sign_BYTES 64U int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk, const unsigned char *seed); int crypto_sign_detached(unsigned char *sig, unsigned long long *siglen_p, const unsigned char *m, unsigned long long mlen, const unsigned char *sk); int crypto_sign_verify_detached(const unsigned char *sig, const unsigned char *m, unsigned long long mlen, const unsigned char *pk); #define crypto_kdf_hkdf_sha256_KEYBYTES 32U int crypto_kdf_hkdf_sha256_extract(unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES], const unsigned char *salt, size_t salt_len, const unsigned char *ikm, size_t ikm_len); int crypto_kdf_hkdf_sha256_expand(unsigned char *out, size_t out_len, const char *ctx, size_t ctx_len, const unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES]); #endif