1{ 2 lib, 3 absl-py, 4 buildPythonPackage, 5 cryptography, 6 fetchFromGitHub, 7 fpylll, 8 gmpy, 9 protobuf, 10 pybind11, 11 pytestCheckHook, 12 pythonOlder, 13 scipy, 14 sympy, 15}: 16 17buildPythonPackage { 18 pname = "paranoid-crypto"; 19 version = "unstable-20220819"; 20 format = "setuptools"; 21 22 disabled = pythonOlder "3.9"; 23 24 src = fetchFromGitHub { 25 owner = "google"; 26 repo = "paranoid_crypto"; 27 # https://github.com/google/paranoid_crypto/issues/11 28 rev = "8abccc1619748b93979d1c26234b90d26e88a12e"; 29 hash = "sha256-4yF7WAFAGGhvWTV/y5dGVA/+9r1dqrXU/0/6Edgw3ow="; 30 }; 31 32 nativeBuildInputs = [ 33 protobuf 34 pybind11 35 ]; 36 37 propagatedBuildInputs = [ 38 absl-py 39 cryptography 40 gmpy 41 scipy 42 sympy 43 protobuf 44 ]; 45 46 nativeCheckInputs = [ 47 fpylll 48 pytestCheckHook 49 ]; 50 51 postPatch = '' 52 substituteInPlace requirements.txt \ 53 --replace "protobuf==3.20.*" "protobuf" 54 ''; 55 56 disabledTestPaths = [ 57 # Import issue 58 "paranoid_crypto/lib/randomness_tests/" 59 ]; 60 61 pythonImportsCheck = [ "paranoid_crypto" ]; 62 63 meta = with lib; { 64 description = "Library contains checks for well known weaknesses on cryptographic artifacts"; 65 homepage = "https://github.com/google/paranoid_crypto"; 66 license = with licenses; [ asl20 ]; 67 maintainers = with maintainers; [ fab ]; 68 }; 69}