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
* Update README.rst to fix remaining unclarities in using uv to
install locally built version and various other smaller issues.
* Pipeline changes:
* Build wheel
* Test against locally built wheel
* Make sure no-pqc version doesn't have ML-DSA/ML-KEM enabled.
uv is used to manage virtual environments and building wheels and
source distributions.
This replaces tox.
ruff is used to do static checking.
README is updated to reflect this change.
Random.__init__ used _lib.INVALID_DEVID as a default parameter value,
but INVALID_DEVID is only declared in the CFFI cdef inside
`if features["ML_KEM"] or features["ML_DSA"]`. Since default parameters
are evaluated at module import time, any wolfSSL build that lacks both
ML-KEM and ML-DSA (e.g. via USE_LOCAL_WOLFSSL pointing at a custom
build) raises AttributeError on `import wolfcrypt.random`, cascading
into wolfcrypt.ciphers and effectively breaking the entire library.
Hardcode the default to -2, matching the convention already used by
_Hmac._init and AesGcmStream.__init__ (which call wc_HmacInit /
wc_AesInit with -2 directly rather than referencing _lib.INVALID_DEVID).
Add a build-no-pqc GitHub Actions job that builds wolfSSL with
--disable-kyber --disable-dilithium, installs wolfcrypt-py against it
via USE_LOCAL_WOLFSSL, and runs an import-smoke step plus the full
pytest suite. The smoke step is the explicit regression guard: it
imports wolfcrypt.random and instantiates Random(), which would fail
at import time if the default ever again references a CFFI symbol that
is only conditionally declared.
F-2659