Files
wolfssl/tests/swdev/user_settings.h
T
rizlik 61bfff1dac WOLF_CRYPTO_CB_ONLY_SHA256: strip software SHA-256 and dispatch via swdev
Add WOLF_CRYPTO_CB_ONLY_SHA256: when set, the SHA-256 software.
wc_Sha256FinalRaw is reduced to a stub returning NO_VALID_DEVID, and
sha256.h force-defines WOLFSSL_NO_HASH_RAW so the constant-time TLS HMAC
path falls back to its backend-opaque variant.

Incompatible with
WOLFSSL_SHA224, which aliases the SHA-256 statics; #error guard added.

Add wc_swdev support for SHA-256 for testing.
2026-05-13 16:18:51 +02:00

25 lines
989 B
C

/* tests/swdev/user_settings.h -- settings for wc_swdev.
*
* The swdev software backend must stay ABI-identical to the main library:
* every wolfCrypt struct that crosses the cryptocb boundary (wc_Sha256,
* Aes, RsaKey, ecc_key, ...) is allocated by one compilation and used by
* the other. The only macros that may differ between the two compilations
* are the WOLF_CRYPTO_CB_ONLY_* gates below -- those strip the software
* implementations from the main library so every operation routes through
* the crypto callback; swdev needs the software paths intact. Every other
* setting is inherited from wolfssl/options.h so layouts stay in sync. */
#ifndef WC_SWDEV_USER_SETTINGS_H
#define WC_SWDEV_USER_SETTINGS_H
#include <wolfssl/options.h>
#undef WOLF_CRYPTO_CB_ONLY_RSA
#undef WOLF_CRYPTO_CB_ONLY_ECC
#undef WOLF_CRYPTO_CB_ONLY_SHA256
#ifndef WOLF_CRYPTO_CB
#error "wc_swdev requires the main build to define WOLF_CRYPTO_CB"
#endif
#endif /* WC_SWDEV_USER_SETTINGS_H */