From 9cc4c6863ef1b13726cf41272c50d2d5686bbf58 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel Vuotto Date: Tue, 18 Jun 2024 14:32:35 +0000 Subject: [PATCH] Move aead_impl_*chacha20_poly1305 into their returning function Missed in 24ef3185725866bf39aabbf98d8ee1fe013249f9 . --- aead_chacha20_poly1305.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/aead_chacha20_poly1305.c b/aead_chacha20_poly1305.c index 6f50554..886fe46 100644 --- a/aead_chacha20_poly1305.c +++ b/aead_chacha20_poly1305.c @@ -413,28 +413,28 @@ xchacha20_poly1305_open(uint8_t *out, size_t *outlen, void *initparams, } -static struct lc_aead_impl chacha20_poly1305_impl = { - .seal = &chacha20_poly1305_seal, - .open = &chacha20_poly1305_open, - - .blocklen = LC_CHACHA20_BLOCKLEN, -}; - -static struct lc_aead_impl xchacha20_poly1305_impl = { - .seal = &xchacha20_poly1305_seal, - .open = &xchacha20_poly1305_open, - - .blocklen = LC_XCHACHA20_BLOCKLEN, -}; - const struct lc_aead_impl * lc_aead_impl_chacha20_poly1305(void) { + static struct lc_aead_impl chacha20_poly1305_impl = { + .seal = &chacha20_poly1305_seal, + .open = &chacha20_poly1305_open, + + .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 = { + .seal = &xchacha20_poly1305_seal, + .open = &xchacha20_poly1305_open, + + .blocklen = LC_XCHACHA20_BLOCKLEN, + }; + return &xchacha20_poly1305_impl; }