wolfcrypt-py/wolfcrypt/_ffi
Juliusz Sosinowicz 59a6edc60b Gate FFI declarations and add key validation for optional wolfSSL builds
Build and import the extension against wolfSSL builds that omit optional
features.

- Detect features with the C preprocessor, honoring CC/CPP/CFLAGS/CPPFLAGS.
  setuptools is no longer needed to preprocess the headers.
- Declare FFI functions and expose Python methods only when wolfSSL builds
  them: AES-CTR, AES-CBC, streaming AES-GCM decrypt, SHA-3 per size, HKDF,
  PBKDF2, PEM/DER conversion, PKCS#8, RNG, RSA, ECC, Ed25519, Ed448,
  ML-KEM and ML-DSA. Key DER functions are gated on ASN and
  wc_CryptoInfo.rng on RNG support.
- Validate imported ECC keys with wc_ecc_check_key() and check that a
  private key matches its public point. Skip the pair check when
  wc_ecc_make_pub() is not compiled in. Clear a key that fails the check.
- Size the ECC private key DER buffer with wc_EccKeyDerSize().
- Check the digest size in ECDSA sign(), verify(), sign_raw() and
  verify_raw().
- Disarm ChaCha when set_iv() rejects the nonce length.
- Create the RSA RNG on first use.
- Build the bundled wolfSSL with -fPIC on every Linux platform.
- CI: run on arm64 Linux and add reduced wolfSSL build jobs.

Fenrir: F-8277, F-8279, F-8280, F-8281, F-10069, F-10070, F-10071,
F-11250, F-12224, F-12225, F-12226, F-12227, F-12228, F-12229, F-12230,
F-12231, F-12232, F-12233, F-12234, F-13020, F-13021, F-13023
2026-11-18 09:42:57 +00:00
..
__init__.pyi
…
lib.pyi Gate FFI declarations and add key validation for optional wolfSSL builds 2026-11-18 09:42:57 +00:00