-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IO-like interface for SHAKE-* and other XOFs. #82198
Comments
The SHAKE family functions are the first formally defined XOFs (eXtensible Output Functions), previous implementations such as MGF from PKCS#1 relies on ad-hoc construction. In the current library, SHAKE-* are given digest-like interface, where their output has to be always obtained from the start; where as in reality, there exists applications that consumes such output progressively, such as deterministic key generation from fixed seed, and more specifically, as the random oracle used in Crystals-Dilithium post-quantum digital signature scheme. Therefore, I'd like developers consider adding ``shake.read(len)'' function to support IO-like consumption in hashlib. |
An API of this nature would make more sense to offer in a PyPI SHAKE specific package before we consider if such an API makes sense in the standard library. We want |
@gpshead any chance of having this re-evaluated? XOFs will be used in ML-KEM, it's hard for more standard use than that... and while yes, you shouldn't use ML-KEM (kyber) implementation written in Python for production workloads, Python is the perfect language to teach how algorithms like that work |
This kind of development and maintenance is still best done in third party packages on PyPI. |
the problem is the effect of that on other implementations, like pypy; if it's part of core hashlib, then it needs to be provided by other runtimes, if it's a pypi package, then it may work on some random platform or it may not |
https://pypi.org/project/cryptography/ works on PyPy and is a more natural fit for this kind of thing today. |
just because it runs on PyPy doesn't mean it runs on all alternative runtimes, and just because pyca/cryptography provides the API doesn't mean that
you may not like it, but XOFs are part of the hash ecosystem now |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: