Move aead_impl_*chacha20_poly1305 into their returning function

Missed in 24ef318572 .
This commit is contained in:
Lucas Gabriel Vuotto 2024-06-18 14:32:35 +00:00
parent 5eb28b420d
commit 9cc4c6863e

View File

@ -413,6 +413,9 @@ xchacha20_poly1305_open(uint8_t *out, size_t *outlen, void *initparams,
} }
const struct lc_aead_impl *
lc_aead_impl_chacha20_poly1305(void)
{
static struct lc_aead_impl chacha20_poly1305_impl = { static struct lc_aead_impl chacha20_poly1305_impl = {
.seal = &chacha20_poly1305_seal, .seal = &chacha20_poly1305_seal,
.open = &chacha20_poly1305_open, .open = &chacha20_poly1305_open,
@ -420,6 +423,12 @@ static struct lc_aead_impl chacha20_poly1305_impl = {
.blocklen = LC_CHACHA20_BLOCKLEN, .blocklen = LC_CHACHA20_BLOCKLEN,
}; };
return &chacha20_poly1305_impl;
}
const struct lc_aead_impl *
lc_aead_impl_xchacha20_poly1305(void)
{
static struct lc_aead_impl xchacha20_poly1305_impl = { static struct lc_aead_impl xchacha20_poly1305_impl = {
.seal = &xchacha20_poly1305_seal, .seal = &xchacha20_poly1305_seal,
.open = &xchacha20_poly1305_open, .open = &xchacha20_poly1305_open,
@ -427,14 +436,5 @@ static struct lc_aead_impl xchacha20_poly1305_impl = {
.blocklen = LC_XCHACHA20_BLOCKLEN, .blocklen = LC_XCHACHA20_BLOCKLEN,
}; };
const struct lc_aead_impl *
lc_aead_impl_chacha20_poly1305(void)
{
return &chacha20_poly1305_impl;
}
const struct lc_aead_impl *
lc_aead_impl_xchacha20_poly1305(void)
{
return &xchacha20_poly1305_impl; return &xchacha20_poly1305_impl;
} }