libwebsockets
Lightweight C library for HTML5 websockets
class="ui-resizable-handle">
Loading...
Searching...
No Matches
lws-genchacha.h File Reference
#include <stdint.h>
Include dependency graph for lws-genchacha.h:

Go to the source code of this file.

Data Structures

struct  lws_chacha_ctx
struct  lws_genchacha_ctx

Macros

#define LWS_CHACHA_MINKEYLEN   16
#define LWS_CHACHA_NONCELEN   8
#define LWS_CHACHA_CTRLEN   8
#define LWS_CHACHA_STATELEN   (LWS_CHACHA_NONCELEN+LWS_CHACHA_CTRLEN)
#define LWS_CHACHA_BLOCKLEN   64
#define LWS_POLY1305_TAGLEN   16
#define LWS_POLY1305_KEYLEN   32

Functions

LWS_VISIBLE LWS_EXTERN void lws_chacha_keysetup (struct lws_chacha_ctx *x, const uint8_t *k, uint32_t kbits)
LWS_VISIBLE LWS_EXTERN void lws_chacha_ivsetup (struct lws_chacha_ctx *x, const uint8_t *iv, const uint8_t *counter)
LWS_VISIBLE LWS_EXTERN void lws_chacha_ivsetup_ietf (struct lws_chacha_ctx *x, const uint8_t *nonce, uint32_t counter)
LWS_VISIBLE LWS_EXTERN void lws_chacha_encrypt_bytes (struct lws_chacha_ctx *x, const uint8_t *m, uint8_t *c, uint32_t bytes)
LWS_VISIBLE LWS_EXTERN void lws_poly1305_auth (uint8_t out[LWS_POLY1305_TAGLEN], const uint8_t *m, size_t inlen, const uint8_t key[LWS_POLY1305_KEYLEN])
LWS_VISIBLE LWS_EXTERN int lws_genchacha_create (struct lws_genchacha_ctx *ctx, enum enum_aes_operation op, struct lws_gencrypto_keyelem *el, void *engine)
LWS_VISIBLE LWS_EXTERN int lws_genchacha_destroy (struct lws_genchacha_ctx *ctx)
LWS_VISIBLE LWS_EXTERN int lws_genchacha_crypt (struct lws_genchacha_ctx *ctx, const uint8_t *in, size_t len, uint8_t *out, const uint8_t *nonce, const uint8_t *aad, size_t aad_len, uint8_t *tag, size_t tag_len)
LWS_VISIBLE LWS_EXTERN int lws_genchacha_stream (struct lws_genchacha_ctx *ctx, const uint8_t *in, size_t len, uint8_t *out, const uint8_t *nonce, size_t nonce_len)