diff options
| author | J08nY | 2018-08-10 11:28:55 +0200 |
|---|---|---|
| committer | J08nY | 2018-08-10 11:28:55 +0200 |
| commit | 3cd9747a4081c5448cfd071ce64433a28dd32d55 (patch) | |
| tree | c4133ce567896949bc9e51259b240c0425f2153f /src/cz/crcs/ectester/standalone | |
| parent | 5c0cfd8398282c940407516f4021882b9ed98571 (diff) | |
| download | ECTester-3cd9747a4081c5448cfd071ce64433a28dd32d55.tar.gz ECTester-3cd9747a4081c5448cfd071ce64433a28dd32d55.tar.zst ECTester-3cd9747a4081c5448cfd071ce64433a28dd32d55.zip | |
Add utility methods for converting EC_Params to JCE EC objects.
Diffstat (limited to '')
3 files changed, 5 insertions, 3 deletions
diff --git a/src/cz/crcs/ectester/standalone/ECTesterStandalone.java b/src/cz/crcs/ectester/standalone/ECTesterStandalone.java index 639e416..364fde4 100644 --- a/src/cz/crcs/ectester/standalone/ECTesterStandalone.java +++ b/src/cz/crcs/ectester/standalone/ECTesterStandalone.java @@ -524,6 +524,8 @@ public class ECTesterStandalone { break; } + String suiteName = cli.getArg(0); + StandaloneTestSuite suite = new StandaloneDefaultSuite(writer, cfg, cli); suite.run(); } diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java b/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java index 12bc354..4858ccd 100644 --- a/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java +++ b/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java @@ -76,7 +76,7 @@ public abstract class NativeKeyAgreementSpi extends KeyAgreementSpi { if (publicKey instanceof NativeECPublicKey) { return ((NativeECPublicKey) publicKey).getData(); } else { - return ECUtil.toX962Uncompressed(publicKey.getW(), ((ECParameterSpec) params).getCurve()); + return ECUtil.toX962Uncompressed(publicKey.getW(), ((ECParameterSpec) params)); } } @@ -84,7 +84,7 @@ public abstract class NativeKeyAgreementSpi extends KeyAgreementSpi { if (privateKey instanceof NativeECPrivateKey) { return ((NativeECPrivateKey) privateKey).getData(); } else { - return ECUtil.toByteArray(privateKey.getS(), ((ECParameterSpec) params).getCurve().getField().getFieldSize()); + return ECUtil.toByteArray(privateKey.getS(), ((ECParameterSpec) params).getOrder().bitLength()); } } diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi.java b/src/cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi.java index b60f2c6..602b1c4 100644 --- a/src/cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi.java +++ b/src/cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi.java @@ -71,7 +71,7 @@ public abstract class NativeSignatureSpi extends SignatureSpi { if (signKey instanceof NativeECPrivateKey) { privkey = ((NativeECPrivateKey) signKey).getData(); } else { - privkey = ECUtil.toByteArray(signKey.getS(), params.getCurve().getField().getFieldSize()); + privkey = ECUtil.toByteArray(signKey.getS(), params.getOrder().bitLength()); } return sign(buffer.toByteArray(), privkey, params); } |
