mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-08 03:20:49 +02:00
0f82b9e5fb
Add a software crypto-callback device (wc_swdev) that lets the wolfcrypt test suite run under WOLF_CRYPTO_CB_ONLY_* flags without per-test devId plumbing. The bundle is a separately-compiled second copy of wolfcrypt (software implementations enabled, WOLF_CRYPTO_CB_ONLY_* stripped) linked into testwolfcrypt as a single relocatable object; every symbol is demoted to local via objcopy --keep-global-symbol except wc_SwDev_Callback, so there is no collision with the main libwolfssl. A find callback routes unbound operations (devId == INVALID_DEVID) to the swdev while letting real device IDs pass through. wc_SwDev_Init / wc_SwDev_Cleanup hooks are wired into wolfcrypt/test/test.c. cryptocb_test's WOLF_CRYPTO_CB_FIND and WOLF_CRYPTO_CB_ONLY_RSA blocks are gated off under WOLFSSL_SWDEV. Enable via --enable-swdev (requires --enable-cryptocb).
24 lines
955 B
C
24 lines
955 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
|
|
|
|
#ifndef WOLF_CRYPTO_CB
|
|
#error "wc_swdev requires the main build to define WOLF_CRYPTO_CB"
|
|
#endif
|
|
|
|
#endif /* WC_SWDEV_USER_SETTINGS_H */
|