hide-ffi
The C ABI of the HIDE protocol, and
the single core every language binding (Python, Node, Go, Java, Ruby, PHP,
.NET) calls. No binding reimplements any cryptography: they all load this
library. Builds as cdylib, staticlib and rlib; the header is
include/hide.h.
Rules every caller must follow:
- Everything returned is a length-prefixed
HideBuffer, freed withhide_buffer_free— neverfree(). Text is bytes with a length, so nothing scans attacker-controlled data for a terminator. HideSecretKeyandHideSigningIdentityare opaque; there is deliberately no function that exports key material.- Every function returns
HIDE_OK(0) or an error code; outputs are untouched on error. A panic inside the library is reported asHIDE_ERR_PANIC, never allowed to unwind into the host process.
HideSecretKey *secret = NULL;
HideBuffer public_key = ;
if
HideBuffer container = ;
int32_t rc = ;
HideBuffer plaintext = ;
if
rc = ;
;
;
;
;
Nothing is written to the plaintext buffer unless the whole payload
authenticates, and a decrypted filename must never be used to choose an output
path. This is the only crate in the workspace that allows unsafe.
Experimental and unaudited. Licensed Apache-2.0.