52 #define LWS_GENHASH_LARGEST 64
54 #if defined(LWS_WITH_TLS) && defined(LWS_WITH_GENCRYPTO)
56 struct lws_genhash_ctx {
58 #if defined(LWS_WITH_MBEDTLS)
60 mbedtls_md5_context md5;
61 mbedtls_sha1_context sha1;
62 mbedtls_sha256_context sha256;
63 mbedtls_sha512_context sha512;
64 const mbedtls_md_info_t *hmac;
67 const EVP_MD *evp_type;
72 struct lws_genhmac_ctx {
74 #if defined(LWS_WITH_MBEDTLS)
75 const mbedtls_md_info_t *hmac;
76 mbedtls_md_context_t ctx;
78 const EVP_MD *evp_type;
80 #if defined(LWS_HAVE_EVP_PKEY_new_raw_private_key)
84 #if defined(LWS_HAVE_HMAC_CTX_new)
133 lws_genhash_update(
struct lws_genhash_ctx *ctx,
const void *in,
size_t len);
147 lws_genhash_destroy(
struct lws_genhash_ctx *ctx,
void *result);
163 const uint8_t *key,
size_t key_len);
176 lws_genhmac_update(
struct lws_genhmac_ctx *ctx,
const void *in,
size_t len);
190 lws_genhmac_destroy(
struct lws_genhmac_ctx *ctx,
void *result);
@ LWS_GENHASH_TYPE_SHA384
@ LWS_GENHASH_TYPE_UNKNOWN
@ LWS_GENHASH_TYPE_SHA512
@ LWS_GENHASH_TYPE_SHA256
@ LWS_GENHMAC_TYPE_SHA384
@ LWS_GENHMAC_TYPE_SHA512
@ LWS_GENHMAC_TYPE_UNKNOWN
@ LWS_GENHMAC_TYPE_SHA256
#define LWS_WARN_UNUSED_RESULT