10 cryptography-vectors ? (callPackage ./vectors.nix { }),
25 buildPythonPackage rec {
26 pname = "cryptography";
27 version = "43.0.1"; # Also update the hash in vectors.nix
30 disabled = pythonOlder "3.7";
33 inherit pname version;
34 hash = "sha256-ID6Sp1cW2M+0kdxHx54X0NkgfM/8vLNfWY++RjrjRE0=";
37 cargoDeps = rustPlatform.fetchCargoTarball {
39 sourceRoot = "${pname}-${version}/${cargoRoot}";
40 name = "${pname}-${version}";
41 hash = "sha256-wiAHM0ucR1X7GunZX8V0Jk2Hsi+dVdGgDKqcYjSdD7Q=";
45 substituteInPlace pyproject.toml \
46 --replace-fail "--benchmark-disable" ""
49 cargoRoot = "src/rust";
52 rustPlatform.cargoSetupHook
53 rustPlatform.maturinBuildHook
56 ] ++ lib.optionals (!isPyPy) [ cffi ];
60 ++ lib.optionals stdenv.hostPlatform.isDarwin [
64 ++ lib.optionals (pythonOlder "3.9") [ libxcrypt ];
66 dependencies = lib.optionals (!isPyPy) [ cffi ];
68 optional-dependencies.ssh = [ bcrypt ];
76 ] ++ optional-dependencies.ssh;
78 pytestFlagsArray = [ "--disable-pytest-warnings" ];
81 # save compute time by not running benchmarks
86 vectors = cryptography-vectors;
90 description = "Package which provides cryptographic recipes and primitives";
92 Cryptography includes both high level recipes and low level interfaces to
93 common cryptographic algorithms such as symmetric ciphers, message
94 digests, and key derivation functions.
96 homepage = "https://github.com/pyca/cryptography";
98 "https://cryptography.io/en/latest/changelog/#v" + replaceStrings [ "." ] [ "-" ] version;
99 license = with licenses; [
104 maintainers = with maintainers; [ SuperSandro2000 ];