Files
RyanandClaude Sonnet 5.5 bf40b92c52
Test and deploy enrollment demo / test (push) Successful in 7s
Test and deploy enrollment demo / deploy (push) Successful in 1m12s
Add MQTT enrollment demo with Gitea deploy pipeline
Go backend plus C (libsodium) and C++ (OpenSSL) simulated boards enroll
through a Mosquitto 2.1 broker with Dynamic Security using X25519/HKDF/
Ed25519; a web view shows the run live. The Gitea workflow validates and
builds the images, redeploys the stack on the server with the viewer on
port 8099 and fails unless both boards pass all checks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 21:25:14 +03:30

33 lines
1.6 KiB
C

/* 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 <sodium.h> be found instead. */
#ifndef SODIUM_SHIM_H
#define SODIUM_SHIM_H
#include <stddef.h>
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