Commit Graph
19 Commits
Author SHA1 Message Date
LeoVasanko c6e77cac66 Cleanup. 2025-11-10 08:00:12 +00:00
LeoVasanko cb0f9956c3 Convert all input buffers to memoryview before use and use .nbytes, because len() doesn't work correctly with some buffers. Update docs with a Numpy example. 2025-11-09 21:19:50 +00:00
LeoVasanko 0d63844201 Make Mac class prevent further updates or final after finalisation. Keep cached values for hashlib API. 2025-11-09 20:53:19 +00:00
LeoVasanko 26b883ecbc Simplify implementation: remove bytes_in and bytes_out counters from all classes. 2025-11-09 08:09:26 +00:00
LeoVasanko 87d9a07868 Wipe state structs automatically after use. Simplified aligned allocator and its use via a single handle. 2025-11-09 08:04:00 +00:00
LeoVasanko eed36e2463 API updates:
- Mac class follows hashlib API: digest functions added and finalization no longer modifies state.
- Encryptor and Decryptor now raise RuntimeError if still used after final.

Documentation updated with the changes and  further examples.

Tests updated with the changes, new test module for error cases (test_raises).

Docstrings improved.
2025-11-09 06:53:27 +00:00
LeoVasanko 46bc05f547 Add human-readable algorithm name as NAME constant. 2025-11-09 04:01:05 +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
LeoVasanko f983cbe4c5 util.nonce_increment and util.wipe functions, also exported by each module for convenience. 2025-11-07 21:53:39 +00:00
LeoVasanko 0efc2595d8 Make random_key and random_nonce return bytearray, and add a nonce_increment utility function. 2025-11-07 19:43:33 +00:00
LeoVasanko fc1025f56d Do not return True from MAC verify function on success. 2025-11-07 09:11:24 +00:00
LeoVasanko 3d75cc7e55 Add random_key and random_nonce functions to each submodule. Update docstrings to show the correct lengths for keys and nonces. 2025-11-07 08:03:56 +00:00
LeoVasanko cca78f4224 API cleanup for simplified update/final. Returns bytearrays when into is not used. Allows into buffers larger than needed. Misc other changes. 2025-11-07 07:38:18 +00:00
LeoVasanko 93bdbc26a2 Remove Encryptor.final_detached(), as final() handles both cases identically (only returns MAC). 2025-11-07 04:33:04 +00:00
LeoVasanko 2612dc8187 The update functions of libaegis now return the same number of bytes that went in. Update the binding accordingly. 2025-11-07 04:27:48 +00:00
LeoVasanko 302429b7a4 Add comments to generated files saying how they are generated. 2025-11-07 03:31:29 +00:00
LeoVasanko b83120187c Build cleanup, pathname reorganisation, cdef to repository (although generated with gen_cdef.py). 2025-11-07 03:23:30 +00:00
LeoVasanko 0ae8752666 Rename module to pyaegis, implement build with zig. 2025-11-06 21:34:15 +00:00