summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/phe/default.nix
blob: 5c3e4e2a345d37e8f4bbf0e919ad592a8a27b384 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  isPyPy,
  isPy3k,
  setuptools,
  click,
  gmpy2,
  pytestCheckHook,
  numpy,
}:

buildPythonPackage (finalAttrs: {
  pname = "phe";
  version = "1.5.1";
  pyproject = true;

  # https://github.com/data61/python-paillier/issues/51
  disabled = isPyPy || !isPy3k;

  src = fetchFromGitHub {
    owner = "data61";
    repo = "python-paillier";
    tag = finalAttrs.version;
    hash = "sha256-P//4ZL4+2zcB5sWvujs2N0CHFz+EBLERWrPGLLHj6CY=";
  };

  build-system = [ setuptools ];

  dependencies = [
    click
    gmpy2 # optional, but major speed improvement
  ];

  nativeCheckInputs = [
    pytestCheckHook
    numpy
  ];

  meta = {
    description = "Library for Partially Homomorphic Encryption in Python";
    mainProgram = "pheutil";
    homepage = "https://github.com/data61/python-paillier";
    license = lib.licenses.gpl3;
    maintainers = with lib.maintainers; [ tomasajt ];
  };
})