chacha_ctx
chacha_ctx rs_chacha; /* chacha context for random keystream */
chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits)
chacha_ivsetup(chacha_ctx *x,const u8 *iv)
chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes)
chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter)
chacha_encrypt_bytes(chacha_ctx *x, const u8 *m, u8 *c, u32 bytes)
static inline void chacha_keysetup(struct chacha_ctx *x, const u8 *k, u32 kbits)
static inline void chacha_ivsetup(struct chacha_ctx *x, const u8 *iv,
static inline void chacha_encrypt_bytes(struct chacha_ctx *x, const u8 *m,
typedef struct chacha_ctx chacha_ctx;
chacha_keysetup(chacha_ctx *x, const u8 *k, u32 kbits)
chacha_keysetup((chacha_ctx *)ctx, key, keybits);
chacha_ivsetup((chacha_ctx *)ctx, iv, counter);
chacha_encrypt_bytes((chacha_ctx *)ctx, in, out, (uint32_t)n);
struct chacha_ctx ctx;
chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits)
chacha_ivsetup(chacha_ctx *x,const u8 *iv)
chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes)
static chacha_ctx chacha;
chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter)
chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes)
chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits)
chacha_ctx chacha_ctx;
chacha_keysetup(&chacha_ctx, key, CHACHA20POLY1305_KEY_SIZE * 8);
chacha_ivsetup(&chacha_ctx, (uint8_t *) &le_nonce, NULL);
chacha_encrypt_bytes(&chacha_ctx, b.b0, b.b0, sizeof(b.b0));
chacha_encrypt_bytes(&chacha_ctx, (uint8_t *) src, dst, src_len);
explicit_bzero(&chacha_ctx, sizeof(chacha_ctx));
chacha_ctx chacha_ctx;
chacha_keysetup(&chacha_ctx, key, CHACHA20POLY1305_KEY_SIZE * 8);
chacha_ivsetup(&chacha_ctx, (uint8_t *) &le_nonce, NULL);
chacha_encrypt_bytes(&chacha_ctx, b.b0, b.b0, sizeof(b.b0));
chacha_encrypt_bytes(&chacha_ctx, (uint8_t *) src, dst, dst_len);
explicit_bzero(&chacha_ctx, sizeof(chacha_ctx));
chacha_keysetup((chacha_ctx *)&ctx->block, key, CHACHA20_KEYSIZE * 8);
chacha_ivsetup((chacha_ctx *)ctx->block, iv, ctx->nonce);
chacha_encrypt_bytes((chacha_ctx *)ctx->block, data, data,
chacha_keysetup((chacha_ctx *)&ctx->chacha, key, CHACHA20_KEYSIZE * 8);
chacha_ivsetup((chacha_ctx *)&ctx->chacha, iv, ctx->nonce);
chacha_encrypt_bytes((chacha_ctx *)&ctx->chacha, ctx->key, ctx->key,
static chacha_ctx rs; /* chacha context for random keystream */
chacha_ctx *ctx = malloc(sizeof(chacha_ctx), M_TEMP, M_WAITOK);
explicit_bzero(ctx, sizeof(chacha_ctx));
free(ctx, M_TEMP, sizeof(chacha_ctx));
chacha_encrypt_bytes((chacha_ctx *)ctx, buf, buf, n);
typedef struct chacha_ctx chacha_ctx;
chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits)
chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter)
chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes)
void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int kbits)
void chacha_ivsetup(struct chacha_ctx *x, const u_char *iv, const u_char *ctr)
void chacha_encrypt_bytes(struct chacha_ctx *x, const u_char *m,
struct chacha_ctx main_ctx, header_ctx;