The digest, HMAC, PBKDF2 and scrypt state moves out of the `_hashlib`
module into a feature-gated `rustpython_common::hashlib` that owns each
state behind a `Mutex` and reports plain Rust results; `_hashlib` and
`_blake2` keep the object glue.
The engine writes its state through a raw pointer into a caller-owned
buffer, so the buffer is boxed and only the pointer travels with the
Python object, and it carries the alignment the engine asserts. The
wrapper is built only after a successful init, so a rejected digest name
leaves nothing to drop over storage the engine never wrote.
blake2 moves from `blake2` to `blake2b_simd` / `blake2s_simd`, whose
`Params` carry the whole parameter block. `_blake2.blake2b` and
`blake2s` become immutable types with `SALT_SIZE`, `PERSON_SIZE`,
`MAX_KEY_SIZE` and `MAX_DIGEST_SIZE` as class attributes, and their
instances are instances of those types. They accept `key`, `salt`,
`person`, `fanout`, `depth`, `leaf_size`, `node_offset`, `node_depth`,
`inner_size` and `last_node`. `_hashlib.scrypt` is published on the
same engine.
Six `test_hashlib` expectedFailure markers drop with it. `blake2`,
`digest`, `dyn-clone`, `hmac` and `pbkdf2` lose their last consumer.
Assisted-by: Grok
Assisted-by: Claude
This directory contains all of the Python files that make up the standard
library for RustPython.
Most of these files are copied over from the CPython repository (the 3.7
branch), with slight modifications to allow them to work under RustPython. The
current goal is to complete the standard library with as few modifications as
possible. Current modifications are just temporary workarounds for bugs/missing
feature within the RustPython implementation.
The first big module we are targeting is unittest, so we can leverage the
CPython test suite.