scrypt.py 590 B

12345678910111213141516171819
  1. # This file is dual licensed under the terms of the Apache License, Version
  2. # 2.0, and the BSD License. See the LICENSE file in the root of this repository
  3. # for complete details.
  4. from __future__ import annotations
  5. import sys
  6. from cryptography.hazmat.bindings._rust import openssl as rust_openssl
  7. from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
  8. # This is used by the scrypt tests to skip tests that require more memory
  9. # than the MEM_LIMIT
  10. _MEM_LIMIT = sys.maxsize // 2
  11. Scrypt = rust_openssl.kdf.Scrypt
  12. KeyDerivationFunction.register(Scrypt)
  13. __all__ = ["Scrypt"]