Commit Graph
10 Commits
Author SHA1 Message Date
LeoVasanko 9583a1f9a8 Fix cdef size_t size on Win64 (LLP64), require 64-bit builds
release / build-wheels (linux, bash) (push) Successful in 1m12s
release / build-wheels (windows, cmd) (push) Failing after 1m16s
release / build-wheels (macos, bash) (push) Successful in 1m21s
release / publish-pypi (push) Skipped
The generated cdef typedef'd size_t as unsigned long: 8 bytes on LP64
but only 4 on 64-bit Windows, where C's size_t is 8. cffi's import-time
struct layout verification then failed (aegis_raf_scratch.len: cdef
says 4, C compiler says 8). cffi pre-defines size_t/uint8_t with the
correct platform sizes, so don't typedef them.

Also hard-fail 32-bit build attempts in setup.py; 32-bit platforms are
no longer supported.
2026-10-04 17:32:52 +00:00
LeoVasanko b4404b42e6 Fix ruff 0.16 findings; bump dependency minimums to match
release / build-wheels (windows, cmd) (push) Failing after 11s
release / build-wheels (linux, bash) (push) Failing after 10s
release / build-wheels (macos, bash) (push) Failing after 11s
release / publish-pypi (push) Skipped
- pyproject [tool.ruff.lint]: ignore RUF022/RUF023 (deliberately grouped
  __all__/__slots__), SIM117, BLE001 (blind except is intentional at
  CFFI callback boundaries)
- Legit fixes: dict/tuple instead of typing.Dict/Tuple in generate.py,
  unquoted annotations in raf.py, Self return for __enter__ methods,
  explicit check=False on subprocess.run, collapsed nested ifs, sorted
  test imports, unused-unpacked-variable in test_raises
- Bump minimum versions to the synced toolchain: cffi 2.1.1, ruff
  0.16.10, pytest 9.1.1, auditwheel 6.8.2, setuptools 84.0.0,
  setuptools-scm 10.3.4 (project deps and build-system requires)
2026-10-04 16:24:40 +00:00
LeoVasanko 199dfe7bd9 generate.py: run ruff format on generated files
Running generate.py standalone previously rewrote _ciphers.py with
formatting that differed from the committed (ruff-formatted) style,
creating spurious diffs. release.py already ran ruff after generation;
now generate.py does too, so both entry points leave the tree in the
same state.
2026-10-04 05:41:14 +00:00
LeoVasanko e01d84a560 Add RAF (random-access encrypted file) support and aeg.random CSPRNG
Implement Python bindings for the libaegis 0.10.6 RAF API:

- Thin per-variant wrappers (raf_create/open/read/write/truncate/size/
  sync/close, merkle_rebuild/verify/commitment) generated from a template
  in tools/generate.py, with errno-mapped exceptions.
- aeg.raf: high-level file-like API (Raf, create/open/probe,
  derive_master_key) with pluggable Storage backends (FileStorage,
  BytesIOStorage) and Merkle tree integrity via a MerkleHasher protocol
  (SHA256MerkleHasher default), adapted from pyaegis (MIT).
- aeg.random: CSPRNG facility. Random produces AEGIS keystream seeded
  once from the OS, exposed per cipher module as cipher.random() and
  usable as the RAF RNG (as_raf_rng) or standalone RandomSource.
- Tests: roundtrip/random-access/seek/truncate/Merkle coverage for all
  six variants, pyaegis-style API checks, and a Merkle fuzz test.
2026-10-04 04:25:59 +00:00
LeoVasanko 509898ac73 Make tool scripts executable. 2025-12-31 21:43:25 +00:00
LeoVasanko 67ec091bc5 Add aeg.cipher(alg) for loading modules by name in str. Added aeg.CIPHERS mapping of the nominal names to module names and Cipher for typing literals. 2025-12-31 21:38:30 +00:00
LeoVasanko bd8b183e32 Project renamed to aeg, preparing for PyPI release. 2025-12-23 18:25:03 +00:00
LeoVasanko 5b74bcb683 Always generate LF line endings (even on broken OS). 2025-11-12 23:43:25 +00:00
LeoVasanko 56d304a82e Constants renamed and values extracted from C code rather than function call at runtime. Documentation update. 2025-11-09 03:43:01 +00:00
LeoVasanko 28ee0e1314 Combine the two generator scripts into one that also reads ALIGNMENT and RATE from C sources. 2025-11-09 01:20:15 +00:00