10 cryptography-vectors ? (callPackage ./vectors.nix { }),
25 buildPythonPackage rec {
26 pname = "cryptography";
27 version = "44.0.0"; # Also update the hash in vectors.nix
30 disabled = pythonOlder "3.7";
32 src = fetchFromGitHub {
34 repo = "cryptography";
36 hash = "sha256-A+qYW8GksYk+FQG8ZJHNYrjcouE1CsVH0Lko2ahoYUI=";
39 cargoDeps = rustPlatform.fetchCargoTarball {
41 name = "${pname}-${version}";
42 hash = "sha256-LJIY2O8ul36JQmhiW8VhLCQ0BaX+j+HGr3e8RUkZpc8=";
46 substituteInPlace pyproject.toml \
47 --replace-fail "--benchmark-disable" ""
51 rustPlatform.cargoSetupHook
52 rustPlatform.maturinBuildHook
55 ] ++ lib.optionals (!isPyPy) [ cffi ];
59 ++ lib.optionals stdenv.hostPlatform.isDarwin [
63 ++ lib.optionals (pythonOlder "3.9") [ libxcrypt ];
65 dependencies = lib.optionals (!isPyPy) [ cffi ];
67 optional-dependencies.ssh = [ bcrypt ];
75 ] ++ optional-dependencies.ssh;
77 pytestFlagsArray = [ "--disable-pytest-warnings" ];
80 # save compute time by not running benchmarks
85 vectors = cryptography-vectors;
89 description = "Package which provides cryptographic recipes and primitives";
91 Cryptography includes both high level recipes and low level interfaces to
92 common cryptographic algorithms such as symmetric ciphers, message
93 digests, and key derivation functions.
95 homepage = "https://github.com/pyca/cryptography";
97 "https://cryptography.io/en/latest/changelog/#v" + replaceStrings [ "." ] [ "-" ] version;
98 license = with licenses; [
103 maintainers = with maintainers; [ SuperSandro2000 ];