Gle added the comment:
Alright, I understand the difference in behaviour now. Thanks a lot for the
clear explanation !
Would be nice to have something like:
"""maxmem must be greater than (n * 2 * r * 64) plus a bit of internal
memory for OpenSSL book keeping.
Basica
New submission from Gle :
I can use scrypt KDF with the cryptography module
https://cryptography.io/en/latest/hazmat/primitives/key-derivation-functions/#cryptography.hazmat.primitives.kdf.scrypt.Scrypt
with large parameters (n=2**20, r=16, p=1)
On the other hand, using scrypt KDF from hashlib