argon2.py 632 B

1234567891011121314151617
  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. from cryptography.hazmat.bindings._rust import openssl as rust_openssl
  6. from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
  7. Argon2d = rust_openssl.kdf.Argon2d
  8. Argon2i = rust_openssl.kdf.Argon2i
  9. Argon2id = rust_openssl.kdf.Argon2id
  10. KeyDerivationFunction.register(Argon2d)
  11. KeyDerivationFunction.register(Argon2i)
  12. KeyDerivationFunction.register(Argon2id)
  13. __all__ = ["Argon2d", "Argon2i", "Argon2id"]