Skip to content

Commit fdce9f2

Browse files
committed
feat: add Wei25519 support for SECORA
1 parent 15c3057 commit fdce9f2

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

applet/src/main/java/opencrypto/jcmathlib/ECCurve.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ KeyPair newKeyPair(KeyPair keyPair) {
114114
pubKey.setR(r, (short) 0, (short) r.length);
115115
pubKey.setK(OperationSupport.getInstance().EC_SET_COFACTOR ? k : (short) 1);
116116

117-
privKey.setS(ResourceManager.CONST_ONE, (short) 0, (short) 1);
118-
pubKey.setW(G, (short) 0, (short) G.length);
117+
if (OperationSupport.getInstance().EC_GEN) {
118+
keyPair.genKeyPair();
119+
} else {
120+
privKey.setS(ResourceManager.CONST_ONE, (short) 0, (short) 1);
121+
pubKey.setW(G, (short) 0, (short) G.length);
122+
}
119123

120124
return keyPair;
121125
}

applet/src/main/java/opencrypto/jcmathlib/OperationSupport.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public void setCard(short card_identifier) {
9494
RSA_EXTRA_MOD = true;
9595
RSA_APPEND_MOD = true;
9696
EC_HW_XY = true;
97+
EC_PRECISE_BITLENGTH = false;
9798
break;
9899
default:
99100
break;

applet/src/test/java/tests/BaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public CardManager connectRaw(byte[] installData) throws Exception {
6868
// System.setProperty("com.licel.jcardsim.randomdata.secure", "1");
6969

7070
runCfg.setTestCardType(cardType);
71-
runCfg.setTargetReaderIndex(0);
71+
runCfg.setTargetReaderIndex(2);
7272
if (cardType == CardType.REMOTE){
7373
runCfg.setRemoteAddress("http://127.0.0.1:9901");
7474

0 commit comments

Comments
 (0)