Commit Graph

457 Commits (master)

Author SHA1 Message Date
JacobBarthelmeh cb9885ba53
Merge pull request #143 from embhorn/zd22306
Fix ML-DSA example in docs
2026-08-10 10:25:58 -06:00
Eric Blankenhorn d4b8fbad0e Fix from review 2026-08-07 14:30:49 -05:00
Eric Blankenhorn 58520ace10 Fix ML-DSA example in docs 2026-08-07 14:11:45 -05:00
John Safranek e1bdcab5ea
Merge pull request #138 from MarkAtwood/fix/pin-setuptools-build-backend
build: declare the setuptools build backend floor (F-5426)
2026-08-02 21:38:30 -07:00
Mark Atwood ef980e4d09 build: declare the setuptools build backend floor (F-5426)
[build-system] declared bare `setuptools`, so isolated builds resolved
whatever version the index served at build time. This repo has no uv.lock,
so CI's `uv build --wheel` re-resolves the backend on every run.

Declare `setuptools>=77`. Nothing was broken before this: an unpinned
resolver always fetched a recent backend, so the build worked. The floor is
measured, not chosen. The PEP 639 `license` expression and `license-files`
key already in this file each require setuptools >= 77 independently (76 and
older reject either one alone, while the older `license = {file = ...}`
table form passes), so the project had an undeclared >= 77 requirement that
stayed invisible precisely because the version floated. Declaring it keeps a
build environment pinned below 77 from failing mid-build on an opaque
`project.license` config error with no hint that the fix is an upgrade.

No upper bound, matching the floor-only convention of every other bound in
this file (`cffi>=1.17`, `typing-extensions>=4.4.0`). A ceiling would not
address the reported risk anyway -- a malicious point release satisfies any
range, so only hash-pinned build requirements help there -- and setuptools
ships majors often enough (7 since 2025-03, with 81 and 82 two days apart)
that a stale ceiling silently excludes working versions instead of
protecting anything.

Verified: builds at 77.0.3 and 83.0.0, 76.1.0 refused at resolve time,
License-Expression intact in wheel METADATA, ruff clean, 196 passed.
2026-07-31 15:05:30 -07:00
philljj b297f8a00b
Merge pull request #141 from julek-wolfssl/fenrir-dilithium-ctxlen-fix
Use byte ctxLen in wc_dilithium_verify_ctx_msg cdef (F-4014)
2026-07-29 23:25:42 -05:00
JacobBarthelmeh f82dbb6e11
Merge pull request #142 from kareem-wolfssl/592changelog
Update changelog for 5.9.2 release.
2026-07-16 14:16:03 -06:00
Kareem ec17e626eb Update changelog for 5.9.2 release. 2026-07-16 12:10:13 -07:00
Juliusz Sosinowicz 2fea30cd32 Validate ctx length in MlDsa.verify (F-4014)
MlDsa.sign/sign_with_seed reject a context longer than 255 bytes with
ValueError, but verify did not. With ctxLen now correctly declared as byte in
the cdef, an over-long ctx would surface as a low-level CFFI OverflowError
instead of the consistent ValueError callers get from the signing paths.

Reject len(ctx) > 255 with ValueError in verify, matching sign.
2026-07-16 13:44:55 +00:00
Juliusz Sosinowicz 8bb46362b7 Use byte ctxLen in wc_dilithium_verify_ctx_msg cdef (F-4014)
The CFFI cdef declared wc_dilithium_verify_ctx_msg with word32 ctxLen while the
sign variants use byte ctxLen. wolfSSL's real API (wc_MlDsaKey_VerifyCtx in
wolfcrypt/wc_mldsa.h, which the wc_dilithium_verify_ctx_msg macro forwards to)
takes byte ctxLen, matching FIPS 204's 255-byte context cap. The mismatched
cdef made CFFI marshal a 4-byte word32 into a 1-byte slot, silently truncating
any ctxLen > 255 to its low byte.

Declare ctxLen as byte to match the sign cdef and the underlying API.
2026-07-16 08:48:55 +00:00
sebastian-carpenter a59a4f8b96 update license to GPLv3 2026-07-09 18:24:23 +02:00
David Garske 905682a036
Merge pull request #130 from mjdemilliano/add-hashdrbg-reseed
Random: add DRBG reseed support
2026-07-08 12:28:45 -07:00
David Garske 1cb9b5d6c1
Merge pull request #133 from roberthdevries/pipeline-use-uv-and-ruff
Change workflow to using uv and ruff.
2026-07-08 12:26:11 -07:00
David Garske 2281b705df
Merge pull request #125 from roberthdevries/add-more-typing
Add typing: asn, exceptions, hashes, pwdbased, utils.
2026-07-08 12:26:02 -07:00
Robert de Vries 1a2829a4cd Fixed a few type annotations and added bad type tests.
Also added one note to the ChangeLog.
2026-07-08 15:22:37 +02:00
Robert de Vries 3b5050657f Fix more review comments and remove requirements sub-directory.
All information in requirements is now present in the pyproject.toml file.
2026-07-08 14:39:24 +02:00
Martijn de Milliano c1be234aa6 Process review comments:
- Update lib.pyi
- Remove obsolete comment from test_reseed_multiple
- Update HASHDRBG detection logic to match random.h
2026-07-07 19:14:59 +02:00
Robert de Vries 0d2e15ffed Addressed multiple review comments. 2026-07-06 22:42:35 +02:00
Robert de Vries 35f9108a5f Update Makefile so that lint, test, test-all, check-all work again. 2026-07-06 22:29:31 +02:00
Robert de Vries 55d4a35805 Address review comments
* 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.
2026-07-06 22:29:31 +02:00
Robert de Vries 04b58c0038 Fix ruff errors 2026-07-06 22:29:31 +02:00
Robert de Vries 2c35de76c7 Revert to actions/*v3 2026-07-06 22:29:31 +02:00
Robert de Vries 5126115d38 Fixed github actions document and processed review comments. 2026-07-06 22:29:31 +02:00
Robert de Vries 3078cd5b69 Change workflow to using uv and ruff.
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.
2026-07-06 22:29:31 +02:00
Robert de Vries 397725336e Address more review comments. 2026-07-06 22:27:34 +02:00
Robert de Vries 47b0ac5af9 Fix ruff issues. 2026-07-06 22:13:48 +02:00
Robert de Vries 147021d07c Enable and fix test_chacha_enc_dec. 2026-07-06 22:02:48 +02:00
Robert de Vries 00c57b5e91 Rebased on master and fixed any (extra) issues found with ruff and ty. 2026-07-06 22:02:48 +02:00
Robert de Vries 7f82b412e3 Address more review comments. 2026-07-06 22:02:48 +02:00
Robert de Vries 97766d708b Address more review comments.
Also added a line to the change log to mention that typing information
has been added.
2026-07-06 22:02:48 +02:00
Robert de Vries 66b2ffb7c8 Addressed more review comments. 2026-07-06 22:02:48 +02:00
Robert de Vries fda2869cce Add py.typed file to indicate that this library has typing annotations. 2026-07-06 22:02:48 +02:00
Robert de Vries 747243cc50 Address more review comments.
Tests are now also type checked as this helps verifying the correctness
of the type annotations.
2026-07-06 22:02:48 +02:00
Robert de Vries 1fb34e5cd8 Address review comments and annotate overrides. 2026-07-06 22:02:48 +02:00
Robert de Vries 2081edd6d7 Add typing information to ciphers.py
This has some fallout in random.py to simplify checks.
Also one test is slightly adapted to produced the desired failure.
2026-07-06 22:02:48 +02:00
Robert de Vries d1ac3d5f37 Add typing: asn, exceptions, hashes, hkdf, pwdbased, utils. 2026-07-06 22:02:46 +02:00
David Garske 257151a82c
Merge pull request #127 from roberthdevries/enable-more-ruff-checks
Enable more ruff rules requiring only minor or no fixes.
2026-07-06 08:19:19 -07:00
David Garske b370c19fd9
Merge pull request #136 from roberthdevries/re-instate-coverage-test
Reinstate the possibility to run coverage tests using make cov.
2026-07-06 08:08:44 -07:00
Robert de Vries ba7f942657 Reinstate the possibility to run coverage tests using make cov. 2026-07-05 16:35:30 +02:00
Martijn de Milliano 499bfaa62f Process review comments
- Make test_reseed_multiple deterministic
- Add HAVE_HASHDRBG to windows/non_fips/user_settings.h
2026-07-05 16:30:18 +02:00
Robert de Vries fe648f183b Remove obsolete boiler plate comment from the ruff example configuration. 2026-07-04 16:54:59 +02:00
Robert de Vries 7edbd3e45c Enable more ruff rules requiring only minor or no fixes.
Extra rules:
All E pycodestyle error rules
C4   flake8-comprehensions
DTZ  flake8-datetimez
EXE  flake8-executable
FA   flake8-future-annotations
INT  flake8-gettext
ISC  flake8-implicit-str-concat
ICN  flake8-import-conventions
LOG  flake8-logging
G    flake8-logging-format
RSE  flake8-raise
SLOT flake8-slots
TID  flake8-tidy-imports
TC   flake8-type-checking
FLY  flynt
PERF Perflint
W    pycodestyle warnings
FURB refurb

Ignore E501:  line too long
2026-07-04 16:54:56 +02:00
David Garske c69d2f1eea
Merge pull request #134 from mjdemilliano/prepare-v5.9.2
Prepare for v5.9.2 release
2026-07-02 16:42:48 -07:00
David Garske 17aa8b6c6c
Merge pull request #128 from julek-wolfssl/fenrir/20260623
Fenrir fixes (2026-06-23)
2026-07-02 16:20:26 -07:00
Martijn de Milliano 38c541ab42 ML-DSA: Move check on signing/verifying without context to top
This makes it more clear what the requirements for calling this
function are and avoids unnecessary computations for objects
which are not used.
2026-07-02 13:21:58 +02:00
Martijn de Milliano 8f214f77cd Update changelog 2026-07-02 08:29:17 +02:00
Martijn de Milliano fbe650ac8e Fix typo in comment 2026-07-01 08:13:51 +02:00
Martijn de Milliano 0124b33202 Process review comments for random and test_random
- add pragma no cover
- format using ruff
- fix module factor in test_random
2026-06-30 20:47:41 +02:00
Martijn de Milliano 9cf73e0c42 Update skip reason for test_encrypt_short_tag 2026-06-30 18:55:36 +02:00
Martijn de Milliano c0803d0c66 Update ML-KEM and ML-DSA feature selection + detection 2026-06-30 18:53:45 +02:00