Skip to content

Commit

Permalink
Fix to not allow Shake128/256 with Xilinx AFALG. Cleanup the Shake di…
Browse files Browse the repository at this point in the history
…sable logic to allow forcing off with `WOLFSSL_NO_SHAKE128` and `WOLFSSL_NO_SHAKE256`.
  • Loading branch information
dgarske committed Jul 3, 2024
1 parent ba1eedb commit d3316b7
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions wolfssl/wolfcrypt/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -2032,6 +2032,8 @@ extern void uITRON4_free(void *p) ;
#define WOLFSSL_NOSHA3_224
#define WOLFSSL_NOSHA3_256
#define WOLFSSL_NOSHA3_512
#define WOLFSSL_NO_SHAKE128
#define WOLFSSL_NO_SHAKE256
#endif
#ifdef WOLFSSL_AFALG_XILINX_AES
#undef WOLFSSL_AES_DIRECT
Expand Down Expand Up @@ -3475,22 +3477,27 @@ extern void uITRON4_free(void *p) ;
#define WOLFSSL_RSA_KEY_CHECK
#endif

/* ED448 Requires Shake256 */
#if defined(HAVE_ED448) && defined(WOLFSSL_SHA3)
#undef WOLFSSL_SHAKE256
#define WOLFSSL_SHAKE256
#endif

/* SHAKE - Not allowed in FIPS */
#if defined(WOLFSSL_SHA3) && !defined(HAVE_SELFTEST) && !defined(HAVE_FIPS)
#ifndef WOLFSSL_NO_SHAKE128
#undef WOLFSSL_SHAKE128
#define WOLFSSL_SHAKE128
#endif
#ifndef WOLFSSL_NO_SHAKE256
#undef WOLFSSL_SHAKE256
#define WOLFSSL_SHAKE256
#endif
#else
#if defined(WOLFSSL_SHA3) && (defined(HAVE_SELFTEST) || defined(HAVE_FIPS))
#undef WOLFSSL_NO_SHAKE128
#define WOLFSSL_NO_SHAKE128
#undef WOLFSSL_NO_SHAKE256
#define WOLFSSL_NO_SHAKE256
#endif
/* SHAKE Disable */
#ifdef WOLFSSL_NO_SHAKE128
#undef WOLFSSL_SHAKE128
#endif
#ifdef WOLFSSL_NO_SHAKE256
#undef WOLFSSL_SHAKE256
#endif


/* Encrypted Client Hello - requires HPKE */
#if defined(HAVE_ECH) && !defined(HAVE_HPKE)
Expand Down

0 comments on commit d3316b7

Please sign in to comment.