24 , setuptoolsRustBuildHook
28 cryptography-vectors = callPackage ./vectors.nix { };
30 buildPythonPackage rec {
31 pname = "cryptography";
32 version = "41.0.3"; # Also update the hash in vectors.nix
34 disabled = pythonOlder "3.7";
37 inherit pname version;
38 hash = "sha256-bRknQRE+9eMNidy1uVbvThV48wRwhwG4tz044+FGHzQ=";
41 cargoDeps = rustPlatform.fetchCargoTarball {
43 sourceRoot = "${pname}-${version}/${cargoRoot}";
44 name = "${pname}-${version}";
45 hash = "sha256-LQu7waympGUs+CZun2yDQd2gUUAgyisKBG5mddrfSo0=";
49 substituteInPlace pyproject.toml \
50 --replace "--benchmark-disable" ""
53 cargoRoot = "src/rust";
56 rustPlatform.cargoSetupHook
57 setuptoolsRustBuildHook
61 ] ++ lib.optionals (!isPyPy) [
67 ] ++ lib.optionals stdenv.isDarwin [
70 ] ++ lib.optionals (pythonOlder "3.9") [
74 propagatedBuildInputs = lib.optionals (!isPyPy) [
90 "--disable-pytest-warnings"
94 # save compute time by not running benchmarks
96 ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
97 # aarch64-darwin forbids W+X memory, but this tests depends on it:
98 # * https://cffi.readthedocs.io/en/latest/using.html#callbacks
99 "tests/hazmat/backends/test_openssl_memleak.py"
103 description = "A package which provides cryptographic recipes and primitives";
105 Cryptography includes both high level recipes and low level interfaces to
106 common cryptographic algorithms such as symmetric ciphers, message
107 digests, and key derivation functions.
109 homepage = "https://github.com/pyca/cryptography";
110 changelog = "https://cryptography.io/en/latest/changelog/#v"
111 + replaceStrings [ "." ] [ "-" ] version;
112 license = with licenses; [ asl20 bsd3 psfl ];
113 maintainers = with maintainers; [ SuperSandro2000 ];