aboutsummaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/applet
diff options
context:
space:
mode:
authorJ08nY2018-08-12 14:08:57 +0200
committerJ08nY2018-08-12 14:08:57 +0200
commit574a46017950e4e04b9e52cb52c74ad9948060cb (patch)
treee861c90f483a8a5dc29523c14496ccf7d4189eda /src/cz/crcs/ectester/applet
parentfb19b67c5f707af80cba280efa0ae0fa20d7fc8f (diff)
downloadECTester-574a46017950e4e04b9e52cb52c74ad9948060cb.tar.gz
ECTester-574a46017950e4e04b9e52cb52c74ad9948060cb.tar.zst
ECTester-574a46017950e4e04b9e52cb52c74ad9948060cb.zip
Reformat all code.
Diffstat (limited to 'src/cz/crcs/ectester/applet')
-rw-r--r--src/cz/crcs/ectester/applet/ECKeyGenerator.java4
-rw-r--r--src/cz/crcs/ectester/applet/ECKeyTester.java16
-rw-r--r--src/cz/crcs/ectester/applet/ECTesterApplet.java30
3 files changed, 21 insertions, 29 deletions
diff --git a/src/cz/crcs/ectester/applet/ECKeyGenerator.java b/src/cz/crcs/ectester/applet/ECKeyGenerator.java
index 9150248..7c52e8f 100644
--- a/src/cz/crcs/ectester/applet/ECKeyGenerator.java
+++ b/src/cz/crcs/ectester/applet/ECKeyGenerator.java
@@ -39,7 +39,6 @@ public class ECKeyGenerator {
}
/**
- *
* @param keypair
* @param key
* @return
@@ -70,7 +69,6 @@ public class ECKeyGenerator {
}
/**
- *
* @param keypair
* @param curve
* @param buffer
@@ -82,7 +80,6 @@ public class ECKeyGenerator {
}
/**
- *
* @param keypair
* @param curve
* @param params
@@ -95,7 +92,6 @@ public class ECKeyGenerator {
}
/**
- *
* @param keypair
* @param key
* @param curve
diff --git a/src/cz/crcs/ectester/applet/ECKeyTester.java b/src/cz/crcs/ectester/applet/ECKeyTester.java
index 7c091e3..6b5aa6b 100644
--- a/src/cz/crcs/ectester/applet/ECKeyTester.java
+++ b/src/cz/crcs/ectester/applet/ECKeyTester.java
@@ -46,13 +46,13 @@ public class ECKeyTester {
* Uses {@code pubkeyBuffer} at {@code pubkeyOffset} for computations.
* Output should equal with ECDHC output.
*
- * @param privatePair KeyPair from which the private key is used
- * @param publicPair KeyPair from which the public key is used
- * @param pubkeyBuffer buffer to be used for the public key
- * @param pubkeyOffset offset into pubkeyBuffer that can be used for the public key
- * @param outputBuffer buffer to be used for the secret output
- * @param outputOffset offset into the outputBuffer
- * @param transformation (EC_Consts.TRANSFORMATION_* | ...)
+ * @param privatePair KeyPair from which the private key is used
+ * @param publicPair KeyPair from which the public key is used
+ * @param pubkeyBuffer buffer to be used for the public key
+ * @param pubkeyOffset offset into pubkeyBuffer that can be used for the public key
+ * @param outputBuffer buffer to be used for the secret output
+ * @param outputOffset offset into the outputBuffer
+ * @param transformation (EC_Consts.TRANSFORMATION_* | ...)
* @return derived secret length
**/
public short testKA(KeyPair privatePair, KeyPair publicPair, byte[] pubkeyBuffer, short pubkeyOffset, byte[] outputBuffer, short outputOffset, short transformation) {
@@ -131,7 +131,6 @@ public class ECKeyTester {
}
/**
- *
* @param signKey
* @param inputBuffer
* @param inputOffset
@@ -154,7 +153,6 @@ public class ECKeyTester {
}
/**
- *
* @param verifyKey
* @param inputBuffer
* @param inputOffset
diff --git a/src/cz/crcs/ectester/applet/ECTesterApplet.java b/src/cz/crcs/ectester/applet/ECTesterApplet.java
index d0ca8f5..17c8faf 100644
--- a/src/cz/crcs/ectester/applet/ECTesterApplet.java
+++ b/src/cz/crcs/ectester/applet/ECTesterApplet.java
@@ -477,7 +477,6 @@ public class ECTesterApplet extends Applet implements ExtendedLength {
}
/**
- *
* @param apdu P1 = byte keyPair (KEYPAIR_*)
* P2 = byte export (EXPORT_TRUE || EXPORT_FALSE)
* DATA = byte sigType
@@ -502,7 +501,6 @@ public class ECTesterApplet extends Applet implements ExtendedLength {
}
/**
- *
* @param apdu P1 = byte keyPair (KEYPAIR_*)
* P2 = byte sigType
* DATA = short dataLength (00 = random data generated, !00 = data length)
@@ -609,12 +607,12 @@ public class ECTesterApplet extends Applet implements ExtendedLength {
}
/**
- * @param keyPair KeyPair to transform
- * @param key key to transform (EC_Consts.KEY_* | ...)
- * @param params parameters to transform (EC_Consts.PARAMETER_* | ...)
+ * @param keyPair KeyPair to transform
+ * @param key key to transform (EC_Consts.KEY_* | ...)
+ * @param params parameters to transform (EC_Consts.PARAMETER_* | ...)
* @param transformation transformation type (EC_Consts.TRANSFORMATION_*)
- * @param outBuffer buffer to output sw to
- * @param outOffset output offset in buffer
+ * @param outBuffer buffer to output sw to
+ * @param outOffset output offset in buffer
* @return length of data written to the buffer
*/
private short transform(KeyPair keyPair, byte key, short params, short transformation, byte[] outBuffer, short outOffset) {
@@ -665,13 +663,13 @@ public class ECTesterApplet extends Applet implements ExtendedLength {
}
/**
- * @param pubkey keyPair to use for public key, (KEYPAIR_LOCAL || KEYPAIR_REMOTE)
- * @param privkey keyPair to use for private key, (KEYPAIR_LOCAL || KEYPAIR_REMOTE)
- * @param export whether to export ECDH secret
+ * @param pubkey keyPair to use for public key, (KEYPAIR_LOCAL || KEYPAIR_REMOTE)
+ * @param privkey keyPair to use for private key, (KEYPAIR_LOCAL || KEYPAIR_REMOTE)
+ * @param export whether to export ECDH secret
* @param transformation whether to transform the pubkey before ECDH
- * @param type KeyAgreement type to test
- * @param outBuffer buffer to write sw to, and export ECDH secret {@code if(export == EXPORT_TRUE)}
- * @param outOffset output offset in buffer
+ * @param type KeyAgreement type to test
+ * @param outBuffer buffer to write sw to, and export ECDH secret {@code if(export == EXPORT_TRUE)}
+ * @param outOffset output offset in buffer
* @return length of data written to the buffer
*/
private short ecdh(byte pubkey, byte privkey, byte export, short transformation, byte type, byte[] outBuffer, short outOffset) {
@@ -813,9 +811,9 @@ public class ECTesterApplet extends Applet implements ExtendedLength {
short length = 0;
short dataLength = Util.getShort(inBuffer, inOffset);
- short dataOffset = (short)(inOffset + 2);
- short sigLength = Util.getShort(inBuffer, (short)(dataOffset + dataLength));
- short sigOffset = (short)(dataOffset + dataLength + 2);
+ short dataOffset = (short) (inOffset + 2);
+ short sigLength = Util.getShort(inBuffer, (short) (dataOffset + dataLength));
+ short sigOffset = (short) (dataOffset + dataLength + 2);
if (keyTester.getSigType() == sigType) {
keyTester.testECDSA_verify((ECPublicKey) verify.getPublic(), inBuffer, dataOffset, dataLength, inBuffer, sigOffset, sigLength);