kbkdf.py 737 B

1234567891011121314151617181920212223242526
  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 import utils
  6. from cryptography.hazmat.bindings._rust import openssl as rust_openssl
  7. from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
  8. class Mode(utils.Enum):
  9. CounterMode = "ctr"
  10. class CounterLocation(utils.Enum):
  11. BeforeFixed = "before_fixed"
  12. AfterFixed = "after_fixed"
  13. MiddleFixed = "middle_fixed"
  14. KBKDFHMAC = rust_openssl.kdf.KBKDFHMAC
  15. KeyDerivationFunction.register(KBKDFHMAC)
  16. KBKDFCMAC = rust_openssl.kdf.KBKDFCMAC
  17. KeyDerivationFunction.register(KBKDFCMAC)