Skip to content

Commit

Permalink
fixup! Initial ASCON hash256 and AEAD128 support based on NIST SP 800…
Browse files Browse the repository at this point in the history
…-232 ipd
  • Loading branch information
julek-wolfssl committed Dec 27, 2024
1 parent f103561 commit 4c3f281
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions .wolfssl_known_macro_extras
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions wolfcrypt/src/ascon.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ascon.c
*
* Copyright (C) 2006-2023 wolfSSL Inc.
* Copyright (C) 2006-2025 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
Expand All @@ -19,13 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

#ifdef HAVE_ASCON
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <wolfssl/wolfcrypt/settings.h>

#ifdef HAVE_ASCON

#include <wolfssl/wolfcrypt/ascon.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/logging.h>
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/test/ascon-kat.h
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/wolfcrypt/ascon.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ascon.h
*
* Copyright (C) 2006-2023 wolfSSL Inc.
* Copyright (C) 2006-2025 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
Expand Down

0 comments on commit 4c3f281

Please sign in to comment.