From 63beedc171116c5720b40d32daba34b753d6059c Mon Sep 17 00:00:00 2001 From: J08nY Date: Fri, 29 Mar 2024 19:02:00 +0100 Subject: Cleanups in provider classes. --- .../ectester/standalone/libs/jni/NativeKeyAgreementSpi.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'standalone/src/main/java') diff --git a/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java index 894da27..dd982aa 100644 --- a/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java +++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java @@ -368,6 +368,12 @@ public abstract class NativeKeyAgreementSpi extends KeyAgreementSpi { native SecretKey generateSecret(byte[] pubkey, byte[] privkey, ECParameterSpec params, String algorithm); } + public static class LibresslECDH extends Libressl { + public LibresslECDH() { + super("ECDH"); + } + } + public abstract static class Nettle extends SimpleKeyAgreementSpi { private final String type; @@ -378,6 +384,7 @@ public abstract class NativeKeyAgreementSpi extends KeyAgreementSpi { @Override byte[] generateSecret(byte[] pubkey, byte[] privkey, ECParameterSpec params) { try { + // TODO: OMG remove this monstrosity. AlgorithmParameters tmp = AlgorithmParameters.getInstance("EC"); tmp.init(params); ECGenParameterSpec spec = tmp.getParameterSpec(ECGenParameterSpec.class); @@ -420,10 +427,4 @@ public abstract class NativeKeyAgreementSpi extends KeyAgreementSpi { super("ECDH"); } } - public static class LibresslECDH extends Libressl { - public LibresslECDH() { - super("ECDH"); - } - } - } -- cgit v1.3.1