|
Csilk 0.2.1
A lightweight, high-performance C HTTP web framework
|
Pluggable cryptographic primitive driver. More...
#include <csilk.h>
Data Fields | |
| void(* | sha256 )(const uint8_t *data, size_t len, uint8_t out[32]) |
| Compute the SHA-256 hash of a buffer. | |
| void(* | hmac_sha256 )(const uint8_t *key, size_t key_len, const uint8_t *data, size_t data_len, uint8_t out[32]) |
| Compute HMAC-SHA256 (RFC 2104). | |
| void(* | generate_uuid )(char buf[37]) |
| Generate a random version-4 UUID string. Uses /dev/urandom or driver-specific entropy source. | |
Pluggable cryptographic primitive driver.
Allows users to replace the default software implementations of SHA256, HMAC-SHA256, and UUID generation (e.g., with hardware-accelerated or FIPS-compliant versions). All function pointers must be non-NULL. Set via csilk_server_set_crypto_driver and propagated to all request contexts. Functions are called synchronously on the event-loop thread.
Allows users to replace the default software implementations of SHA256, HMAC-SHA256, and UUID generation (e.g., with hardware-accelerated or FIPS-compliant versions). All function pointers must be non-NULL.
| void(* csilk_crypto_driver_t::generate_uuid)(char buf[37]) |
Generate a random version-4 UUID string. Uses /dev/urandom or driver-specific entropy source.
Generate a random version-4 UUID string.
| [out] | buf | Output buffer of at least 37 bytes. Populated with a NUL-terminated UUID string (e.g., "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"). |
| [out] | buf | Output buffer of at least 37 bytes. Populated with a NUL-terminated UUID string. |
| void(* csilk_crypto_driver_t::hmac_sha256)(const uint8_t *key, size_t key_len, const uint8_t *data, size_t data_len, uint8_t out[32]) |
Compute HMAC-SHA256 (RFC 2104).
Compute HMAC-SHA256.
| key | HMAC key. | |
| key_len | Key length. | |
| data | Input data. | |
| data_len | Input length. | |
| [out] | out | 32-byte HMAC output. |
| void(* csilk_crypto_driver_t::sha256)(const uint8_t *data, size_t len, uint8_t out[32]) |
Compute the SHA-256 hash of a buffer.
| data | Input data. | |
| len | Input length. | |
| [out] | out | 32-byte hash output. |