26 cryptography-vectors = callPackage ./vectors.nix { };
28 buildPythonPackage rec {
29 pname = "cryptography";
30 version = "38.0.1"; # Also update the hash in vectors.nix
31 disabled = pythonOlder "3.6";
34 inherit pname version;
35 hash = "sha256-HbPYB6FJMfoxf5ZDVpXZ7Dhr57hLYYzGHPpdCLCuM9c=";
38 cargoDeps = rustPlatform.fetchCargoTarball {
40 sourceRoot = "${pname}-${version}/${cargoRoot}";
41 name = "${pname}-${version}";
42 hash = "sha256-o8l13fnfEUvUdDasq3LxSPArozRHKVsZfQg9DNR6M6Q=";
45 cargoRoot = "src/rust";
47 nativeBuildInputs = lib.optionals (!isPyPy) [
50 rustPlatform.cargoSetupHook
52 ] ++ (with rustPlatform; [ rust.cargo rust.rustc ]);
54 buildInputs = [ openssl ]
55 ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
57 propagatedBuildInputs = lib.optionals (!isPyPy) [
73 "--disable-pytest-warnings"
76 disabledTestPaths = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
77 # aarch64-darwin forbids W+X memory, but this tests depends on it:
78 # * https://cffi.readthedocs.io/en/latest/using.html#callbacks
79 "tests/hazmat/backends/test_openssl_memleak.py"
83 description = "A package which provides cryptographic recipes and primitives";
85 Cryptography includes both high level recipes and low level interfaces to
86 common cryptographic algorithms such as symmetric ciphers, message
87 digests, and key derivation functions.
88 Our goal is for it to be your "cryptographic standard library". It
89 supports Python 2.7, Python 3.5+, and PyPy 5.4+.
91 homepage = "https://github.com/pyca/cryptography";
92 changelog = "https://cryptography.io/en/latest/changelog/#v"
93 + replaceStrings [ "." ] [ "-" ] version;
94 license = with licenses; [ asl20 bsd3 psfl ];
95 maintainers = with maintainers; [ SuperSandro2000 ];