calog/libs/calogCrypto.h

26 lines
1.2 KiB
C

// calogCrypto.h -- calog cryptography library.
//
// Bridges binary-safe calog strings to OpenSSL's one-shot primitives, so any engine gets
// hashing, HMAC, randomness, and common encodings without an engine-specific library:
// cryptoHashSha256(data) -> lowercase hex digest (64 chars)
// cryptoHashSha1(data) -> lowercase hex digest (40 chars)
// cryptoHmacSha256(key, data) -> lowercase hex HMAC-SHA-256 (64 chars)
// cryptoRandomBytes(count) -> binary string of count cryptographically-random bytes
// cryptoBase64Encode(data) -> base64 text
// cryptoBase64Decode(text) -> decoded binary string
// cryptoHexEncode(data) -> lowercase hex text
// cryptoHexDecode(hexText) -> decoded binary string
// cryptoUuid() -> random RFC 4122 version-4 UUID string
// All natives are binary-safe and INLINE (pure computation over OpenSSL one-shots, no shared
// state), so there is nothing to shut down.
#ifndef CALOG_CRYPTO_H
#define CALOG_CRYPTO_H
#include "calog.h"
// Register the crypto natives on a runtime. Stateless: safe to call on any number of
// runtimes, and there is no matching shutdown.
int32_t calogCryptoRegister(CalogT *calog);
#endif