Skip to content
Snippets Groups Projects
Commit 84777eab authored by Johannes Hitzinger's avatar Johannes Hitzinger
Browse files

initial commit with dilithium working via nix

dont create new venv, handle "which python" path as venv
parent cc4fa077
No related branches found
No related tags found
No related merge requests found
.envrc 0 → 100644
use nix
{
buildPythonPackage,
fetchPypi,
# propagates
numpy,
pycryptodome,
}:
buildPythonPackage rec {
pname = "dilithium";
version = "1.0.6";
src = fetchPypi {
inherit pname version;
hash = "sha256-PZeFjvUCuIM3AGpTY/j6Pi9VrpWPYFEBWgltnqWtOeo=";
};
propagatedBuildInputs = [
numpy
pycryptodome
];
pythonImportsCheck = [
"dilithium"
];
}
\ No newline at end of file
import dilithium.dilithium
from dilithium import Dilithium
d1 = Dilithium(dilithium.dilithium.DEFAULT_PARAMETERS["dilithium3"])
a, b = d1.keygen([1,2,3,4])
print(a)
print(b)
\ No newline at end of file
{
pkgs ? import <nixpkgs> { },
}:
let
mypython = pkgs.python3.withPackages (python-pkgs: [
python-pkgs.numpy
(python-pkgs.callPackage ./dilithium.nix { })
]);
in
pkgs.mkShell {
buildInputs = [
mypython
];
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment