From 4c3f2813cc71e458d33fa6631c288b0c6d3d672a Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Fri, 27 Dec 2024 14:21:01 +0100 Subject: [PATCH] fixup! Initial ASCON hash256 and AEAD128 support based on NIST SP 800-232 ipd --- .wolfssl_known_macro_extras | 1 + wolfcrypt/src/ascon.c | 13 +++++++------ wolfcrypt/test/ascon-kat.h | 2 +- wolfssl/wolfcrypt/ascon.h | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.wolfssl_known_macro_extras b/.wolfssl_known_macro_extras index 5611220e5f..c150508971 100644 --- a/.wolfssl_known_macro_extras +++ b/.wolfssl_known_macro_extras @@ -563,6 +563,7 @@ WOLFSSL_ALLOW_TLS_SHA1 WOLFSSL_ALTERNATIVE_DOWNGRADE WOLFSSL_ALT_NAMES_NO_REV WOLFSSL_ARM_ARCH_NEON_64BIT +WOLFSSL_ASCON_UNROLL WOLFSSL_ASNC_CRYPT WOLFSSL_ASN_EXTRA WOLFSSL_ASN_INT_LEAD_0_ANY diff --git a/wolfcrypt/src/ascon.c b/wolfcrypt/src/ascon.c index b2b0d35526..11ec9478cd 100644 --- a/wolfcrypt/src/ascon.c +++ b/wolfcrypt/src/ascon.c @@ -1,6 +1,6 @@ /* ascon.c * - * Copyright (C) 2006-2023 wolfSSL Inc. + * Copyright (C) 2006-2025 wolfSSL Inc. * * This file is part of wolfSSL. * @@ -19,13 +19,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_ASCON #ifdef HAVE_CONFIG_H #include #endif #include +#ifdef HAVE_ASCON + #include #include #include @@ -176,8 +177,8 @@ static void permutation(AsconState* a, byte rounds) wc_AsconHash256* wc_AsconHash256_New(void) { - wc_AsconHash256* ret = (wc_AsconHash256*)XMALLOC(sizeof(wc_AsconHash256), NULL, - DYNAMIC_TYPE_ASCON); + wc_AsconHash256* ret = (wc_AsconHash256*)XMALLOC(sizeof(wc_AsconHash256), + NULL, DYNAMIC_TYPE_ASCON); if (ret != NULL) { if (wc_AsconHash256_Init(ret) != 0) { wc_AsconHash256_Free(ret); @@ -278,8 +279,8 @@ int wc_AsconHash256_Final(wc_AsconHash256* a, byte* hash) wc_AsconAEAD128* wc_AsconAEAD128_New(void) { - wc_AsconAEAD128 *ret = (wc_AsconAEAD128*) XMALLOC(sizeof(wc_AsconAEAD128), NULL, - DYNAMIC_TYPE_ASCON); + wc_AsconAEAD128 *ret = (wc_AsconAEAD128*) XMALLOC(sizeof(wc_AsconAEAD128), + NULL, DYNAMIC_TYPE_ASCON); if (ret != NULL) { if (wc_AsconAEAD128_Init(ret) != 0) { wc_AsconAEAD128_Free(ret); diff --git a/wolfcrypt/test/ascon-kat.h b/wolfcrypt/test/ascon-kat.h index ee7af8708d..8690b76e81 100644 --- a/wolfcrypt/test/ascon-kat.h +++ b/wolfcrypt/test/ascon-kat.h @@ -1,6 +1,6 @@ /* ascon-kat.h * - * Copyright (C) 2006-2024 wolfSSL Inc. + * Copyright (C) 2006-2025 wolfSSL Inc. * * This file is part of wolfSSL. * diff --git a/wolfssl/wolfcrypt/ascon.h b/wolfssl/wolfcrypt/ascon.h index fd50ce67b9..00b2e2d6fb 100644 --- a/wolfssl/wolfcrypt/ascon.h +++ b/wolfssl/wolfcrypt/ascon.h @@ -1,6 +1,6 @@ /* ascon.h * - * Copyright (C) 2006-2023 wolfSSL Inc. + * Copyright (C) 2006-2025 wolfSSL Inc. * * This file is part of wolfSSL. *