aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquapka2024-07-25 14:42:53 +0200
committerquapka2024-07-25 14:42:53 +0200
commitc625e03c43a3089c42ec34ba272f25dff0733611 (patch)
tree024f33e205393b4b52a9e10cfeac9e8280def67b
parent943c182453bb22e7bd704dfe8ac9414286d06690 (diff)
downloadECTester-c625e03c43a3089c42ec34ba272f25dff0733611.tar.gz
ECTester-c625e03c43a3089c42ec34ba272f25dff0733611.tar.zst
ECTester-c625e03c43a3089c42ec34ba272f25dff0733611.zip
-rw-r--r--flake.nix2
-rw-r--r--nix/cryptoppshim.nix23
2 files changed, 25 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index c841ce4..44fe3f6 100644
--- a/flake.nix
+++ b/flake.nix
@@ -120,6 +120,7 @@
# Current list of targets: tomcrypt botan cryptopp openssl boringssl gcrypt mbedtls ippcp nettle libressl
tomcryptShim = import ./nix/tomcryptshim.nix { inherit pkgs libtomcrypt libtommath; };
botanShim = import ./nix/botanshim.nix { inherit pkgs; };
+ cryptoppShim = import ./nix/cryptoppshim.nix { inherit pkgs cryptopp; };
mbedtlsShim = import ./nix/mbedtlsshim.nix { pkgs = pkgs; };
ippcryptoShim = import ./nix/ippcryptoshim.nix { pkgs = pkgs; ipp-crypto = customPkgs.ipp-crypto; };
@@ -158,6 +159,7 @@
popd
cp ${tomcryptShim.out}/lib/tomcrypt_provider.so ${jniLibsPath}
cp ${botanShim.out}/lib/botan_provider.so ${jniLibsPath}
+ cp ${cryptoppShim.out}/lib/cryptopp_provider.so ${jniLibsPath}
cp ${commonLibs}/lib/* ${jniLibsPath}
'';
diff --git a/nix/cryptoppshim.nix b/nix/cryptoppshim.nix
new file mode 100644
index 0000000..1c3532c
--- /dev/null
+++ b/nix/cryptoppshim.nix
@@ -0,0 +1,23 @@
+{
+ pkgs
+ , cryptopp
+}:
+with pkgs; stdenv.mkDerivation {
+ name = "Crypto++ Shim";
+ src = ../standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni;
+
+ buildInputs = [
+ cryptopp
+ pkg-config
+ jdk11_headless
+ ];
+
+ buildPhase = ''
+ make cryptopp
+ '';
+
+ installPhase = ''
+ mkdir --parents $out/lib
+ cp cryptopp_provider.so $out/lib/
+ '';
+}