Welcome to little lamb

Code » limb » release » tree

[release] / src / liblimb / chacha20.h / chacha20.c

/* This file is part of limb                           https://lila.oss/limb
 * Copyright (C) 2023 Olivier Brunel                          jjk@jjacky.com */
/* SPDX-License-Identifier: GPL-2.0-only */
#include <limb/chacha20.h>

void
chacha20(void *dst, const void *key, const void *nonce, const void *msg, size_t mlen)
{
    chacha20_ctx ctx;

    chacha20_init(key, nonce, &ctx);
    chacha20_crypt(dst, msg, mlen, &ctx);
    chacha20_clear(&ctx);
}