Skip to content

Commit

Permalink
Merge pull request #161 from crocs-muni/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
petrs authored Apr 4, 2018
2 parents 44c0cf4 + 1829967 commit 20e8207
Show file tree
Hide file tree
Showing 3 changed files with 293 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AlgTest_JClient/src/algtestjclient/CardMngr.java
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ public int GenerateAndGetKeys(FileOutputStream file, int numRepeats, int resetFr
byte apduPrivate[] = this.prepareApduForKeyHarvest(privateKeySetting);

int errors = 0;
while(numKeysGenerated < numRepeats) {
while (numKeysGenerated < numRepeats) {
try {
key.setLength(0);
if ((resetFrequency > 0) && (numKeysGenerated % resetFrequency == 0)) { bResetCard = true; }
Expand Down
3 changes: 1 addition & 2 deletions AlgTest_JClient/src/algtestjclient/PerformanceTesting.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,15 @@ public void testECCPerformance(String[] args, boolean bTestVariableDataLengths,
short numRepeatWholeOperation = (short) 3;

testKeyAgreementWithKeyClass(JCConsts.KeyPair_ALG_EC_FP, JCConsts.KeyBuilder_TYPE_EC_FP_PRIVATE, JCConsts.KeyBuilder_LENGTH_EC_FP_256, JCConsts.KeyAgreement_ALG_EC_SVDP_DH_PLAIN, "ALG_EC_FP LENGTH_EC_FP_256 ALG_EC_SVDP_DH_PLAIN", numRepeatWholeOperation, numRepeatWholeMeasurement);

// Test speed of message digest - applied in some options of KeyAgreement.generateSecret()
testMessageDigest(JCConsts.MessageDigest_ALG_SHA_256, "ALG_SHA_256", numRepeatWholeOperation, numRepeatWholeMeasurement);
testRandomGenerator(JCConsts.RandomData_ALG_SECURE_RANDOM, "ALG_SECURE_RANDOM", numRepeatWholeOperation, numRepeatWholeMeasurement);
testSignatureWithKeyClass(JCConsts.KeyPair_ALG_EC_FP, JCConsts.KeyBuilder_TYPE_EC_FP_PRIVATE, JCConsts.KeyBuilder_LENGTH_EC_FP_256, JCConsts.Signature_ALG_ECDSA_SHA, "KeyPair_ALG_EC_FP KeyBuilder_LENGTH_EC_FP_256 Signature_ALG_ECDSA_SHA", numRepeatWholeOperation, numRepeatWholeMeasurement);
testKeyPair(JCConsts.KeyPair_ALG_EC_FP, JCConsts.KeyBuilder_LENGTH_EC_FP_256, "ALG_EC_FP LENGTH_EC_FP_256", numRepeatWholeOperation, numRepeatWholeMeasurement);
testKeyAgreementWithKeyClass(JCConsts.KeyPair_ALG_EC_FP, JCConsts.KeyBuilder_TYPE_EC_FP_PRIVATE, JCConsts.KeyBuilder_LENGTH_EC_FP_256, JCConsts.KeyAgreement_ALG_EC_SVDP_DH, "ALG_EC_FP LENGTH_EC_FP_256 ALG_EC_SVDP_DH", numRepeatWholeOperation, numRepeatWholeMeasurement);
testKeyAgreementWithKeyClass(JCConsts.KeyPair_ALG_EC_FP, JCConsts.KeyBuilder_TYPE_EC_FP_PRIVATE, JCConsts.KeyBuilder_LENGTH_EC_FP_256, JCConsts.KeyAgreement_ALG_EC_SVDP_DH_PLAIN, "ALG_EC_FP LENGTH_EC_FP_256 ALG_EC_SVDP_DH_PLAIN", numRepeatWholeOperation, numRepeatWholeMeasurement);
//testKeyAgreementWithKeyClass(JCConsts.KeyPair_ALG_EC_FP, JCConsts.KeyBuilder_TYPE_EC_FP_PRIVATE, JCConsts.KeyBuilder_LENGTH_EC_FP_256, JCConsts.KeyAgreement_ALG_EC_PACE_GM, "ALG_EC_FP LENGTH_EC_FP_256 ALG_EC_PACE_GM", numRepeatWholeOperation, numRepeatWholeMeasurement);
testKeyAgreementWithKeyClass(JCConsts.KeyPair_ALG_EC_FP, JCConsts.KeyBuilder_TYPE_EC_FP_PRIVATE, JCConsts.KeyBuilder_LENGTH_EC_FP_256, JCConsts.KeyAgreement_ALG_EC_SVDP_DH_PLAIN_XY, "ALG_EC_FP LENGTH_EC_FP_256 ALG_EC_SVDP_DH_PLAIN_XY", numRepeatWholeOperation, numRepeatWholeMeasurement);
testMessageDigest(JCConsts.MessageDigest_ALG_SHA_256, "ALG_SHA_256", numRepeatWholeOperation, numRepeatWholeMeasurement);


for (String opName : m_algsAvgTime.keySet()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
INFO: This file was generated by AlgTest utility. See http://www.fi.muni.cz/~xsvenda/jcsupport.html for more results, source codes and other details.;
Tested and provided by; PetrS
Execution date/time; 2018/04/03 20:13:35
AlgTestJClient version; 1.7.3
AlgTest applet version; 1.7.3
Used reader; PC/SC terminal Generic EMV Smartcard Reader 0
Card ATR; 3b d5 18 ff 81 91 fe 1f c3 80 73 c8 21 13 09
Card name; Athena IDProtect
Used protocol; T=1

JavaCard support version;2.2.2;
JCSystem.getVersion()[Major.Minor];2.2;
JCSystem.isObjectDeletionSupported;yes;
JCSystem.MEMORY_TYPE_PERSISTENT;>32767B;
JCSystem.MEMORY_TYPE_TRANSIENT_RESET;4157B;
JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT;32767B;
JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT;32767B;

CPLC; 9f 7f 2a 41 80 01 0b 82 11 03 52 00 05 38 31 00 06 35 2b 48 4a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
CPLC.ICFabricator;4180;Atmel
CPLC.ICType;010b
CPLC.OperatingSystemID;8211
CPLC.OperatingSystemReleaseDate;0352
CPLC.OperatingSystemReleaseLevel;0005
CPLC.ICFabricationDate;3831;(Y DDD) date in that year
CPLC.ICSerialNumber;0006352b
CPLC.ICBatchIdentifier;484a
CPLC.ICModuleFabricator;0000
CPLC.ICModulePackagingDate;0000
CPLC.ICCManufacturer;0000
CPLC.ICEmbeddingDate;0000
CPLC.ICPrePersonalizer;0000
CPLC.ICPrePersonalizationEquipmentDate;0000
CPLC.ICPrePersonalizationEquipmentID;00000000
CPLC.ICPersonalizer;0000
CPLC.ICPersonalizationDate;0000
CPLC.ICPersonalizationEquipmentID;00000000
CPLC.ICPersonalizationEquipmentID;00000000


javacardx.crypto.Cipher
ALG_DES_CBC_NOPAD;yes;0.099000
ALG_DES_CBC_ISO9797_M1;yes;0.106000
ALG_DES_CBC_ISO9797_M2;yes;0.110000
ALG_DES_CBC_PKCS5;no;
ALG_DES_ECB_NOPAD;yes;0.104000
ALG_DES_ECB_ISO9797_M1;yes;0.111000
ALG_DES_ECB_ISO9797_M2;yes;0.105000
ALG_DES_ECB_PKCS5;no;
ALG_RSA_ISO14888;no;
ALG_RSA_PKCS1;yes;0.095000
ALG_RSA_ISO9796;no;
ALG_RSA_NOPAD;yes;0.097000
ALG_AES_BLOCK_128_CBC_NOPAD;yes;0.097000
ALG_AES_BLOCK_128_ECB_NOPAD;yes;0.098000
ALG_RSA_PKCS1_OAEP;no;
ALG_KOREAN_SEED_ECB_NOPAD;yes;0.097000
ALG_KOREAN_SEED_CBC_NOPAD;yes;0.098000
ALG_AES_BLOCK_192_CBC_NOPAD;no;
ALG_AES_BLOCK_192_ECB_NOPAD;no;
ALG_AES_BLOCK_256_CBC_NOPAD;no;
ALG_AES_BLOCK_256_ECB_NOPAD;no;
ALG_AES_CBC_ISO9797_M1;no;
ALG_AES_CBC_ISO9797_M2;no;
ALG_AES_CBC_PKCS5;no;
ALG_AES_ECB_ISO9797_M1;no;
ALG_AES_ECB_ISO9797_M2;no;
ALG_AES_ECB_PKCS5;no;

javacard.crypto.Signature
ALG_DES_MAC4_NOPAD;no;
ALG_DES_MAC8_NOPAD;yes;0.099000
ALG_DES_MAC4_ISO9797_M1;no;
ALG_DES_MAC8_ISO9797_M1;yes;0.099000
ALG_DES_MAC4_ISO9797_M2;no;
ALG_DES_MAC8_ISO9797_M2;yes;0.099000
ALG_DES_MAC4_PKCS5;no;
ALG_DES_MAC8_PKCS5;no;
ALG_RSA_SHA_ISO9796;yes;0.101000
ALG_RSA_SHA_PKCS1;yes;0.100000
ALG_RSA_MD5_PKCS1;no;
ALG_RSA_RIPEMD160_ISO9796;no;
ALG_RSA_RIPEMD160_PKCS1;no;
ALG_DSA_SHA;no;
ALG_RSA_SHA_RFC2409;no;
ALG_RSA_MD5_RFC2409;no;
ALG_ECDSA_SHA;yes;0.100000
ALG_AES_MAC_128_NOPAD;yes;0.100000
ALG_DES_MAC4_ISO9797_1_M2_ALG3;no;
ALG_DES_MAC8_ISO9797_1_M2_ALG3;yes;0.100000
ALG_RSA_SHA_PKCS1_PSS;yes;0.101000
ALG_RSA_MD5_PKCS1_PSS;no;
ALG_RSA_RIPEMD160_PKCS1_PSS;no;
ALG_HMAC_SHA1;no;
ALG_HMAC_SHA_256;no;
ALG_HMAC_SHA_384;no;
ALG_HMAC_SHA_512;no;
ALG_HMAC_MD5;no;
ALG_HMAC_RIPEMD160;no;
ALG_RSA_SHA_ISO9796_MR;no;
ALG_RSA_RIPEMD160_ISO9796_MR;no;
ALG_SEED_MAC_NOPAD;yes;0.100000
ALG_ECDSA_SHA_256;yes;0.099000
ALG_ECDSA_SHA_384;no;
ALG_AES_MAC_192_NOPAD;no;
ALG_AES_MAC_256_NOPAD;no;
ALG_ECDSA_SHA_224;yes;0.100000
ALG_ECDSA_SHA_512;no;
ALG_RSA_SHA_224_PKCS1;no;
ALG_RSA_SHA_256_PKCS1;yes;0.099000
ALG_RSA_SHA_384_PKCS1;no;
ALG_RSA_SHA_512_PKCS1;no;
ALG_RSA_SHA_224_PKCS1_PSS;no;
ALG_RSA_SHA_256_PKCS1_PSS;yes;0.100000
ALG_RSA_SHA_384_PKCS1_PSS;no;
ALG_RSA_SHA_512_PKCS1_PSS;no;
ALG_DES_MAC4_ISO9797_1_M1_ALG3;no;
ALG_DES_MAC8_ISO9797_1_M1_ALG3;no;
ALG_AES_CMAC_128;no;

javacard.security.MessageDigest
ALG_SHA;yes;0.100000
ALG_MD5;no;
ALG_RIPEMD160;no;
ALG_SHA_256;yes;0.098000
ALG_SHA_384;yes;0.097000
ALG_SHA_512;yes;0.099000
ALG_SHA_224;yes;0.098000
ALG_SHA3_224;no;
ALG_SHA3_256;no;
ALG_SHA3_384;no;
ALG_SHA3_512;no;

javacard.security.RandomData
ALG_PSEUDO_RANDOM;yes;0.030000
ALG_SECURE_RANDOM;yes;0.031000
ALG_TRNG;no;
ALG_ALG_PRESEEDED_DRBG;no;
ALG_FAST;no;
ALG_KEYGENERATION;no;

javacard.security.KeyBuilder
TYPE_DES_TRANSIENT_RESET;yes;0.056000
TYPE_DES_TRANSIENT_DESELECT;yes;0.091000
TYPE_DES LENGTH_DES;yes;0.046000
TYPE_DES LENGTH_DES3_2KEY;yes;0.046000
TYPE_DES LENGTH_DES3_3KEY;yes;0.048000
TYPE_AES_TRANSIENT_RESET;yes;0.057000
TYPE_AES_TRANSIENT_DESELECT;yes;0.084000
TYPE_AES LENGTH_AES_128;yes;0.046000
TYPE_AES LENGTH_AES_192;yes;0.049000
TYPE_AES LENGTH_AES_256;yes;0.046000
TYPE_RSA_PUBLIC LENGTH_RSA_512;yes;0.047000
TYPE_RSA_PUBLIC LENGTH_RSA_736;yes;0.049000
TYPE_RSA_PUBLIC LENGTH_RSA_768;yes;0.048000
TYPE_RSA_PUBLIC LENGTH_RSA_896;yes;0.048000
TYPE_RSA_PUBLIC LENGTH_RSA_1024;yes;0.047000
TYPE_RSA_PUBLIC LENGTH_RSA_1280;yes;0.052000
TYPE_RSA_PUBLIC LENGTH_RSA_1536;yes;0.050000
TYPE_RSA_PUBLIC LENGTH_RSA_1984;yes;0.057000
TYPE_RSA_PUBLIC LENGTH_RSA_2048;yes;0.051000
TYPE_RSA_PUBLIC LENGTH_RSA_3072;no;
TYPE_RSA_PUBLIC LENGTH_RSA_4096;no;
TYPE_RSA_PRIVATE LENGTH_RSA_512;yes;0.047000
TYPE_RSA_PRIVATE LENGTH_RSA_736;yes;0.053000
TYPE_RSA_PRIVATE LENGTH_RSA_768;yes;0.055000
TYPE_RSA_PRIVATE LENGTH_RSA_896;yes;0.054000
TYPE_RSA_PRIVATE LENGTH_RSA_1024;yes;0.052000
TYPE_RSA_PRIVATE LENGTH_RSA_1280;yes;0.054000
TYPE_RSA_PRIVATE LENGTH_RSA_1536;yes;0.056000
TYPE_RSA_PRIVATE LENGTH_RSA_1984;yes;0.057000
TYPE_RSA_PRIVATE LENGTH_RSA_2048;yes;0.057000
TYPE_RSA_PRIVATE LENGTH_RSA_3072;no;
TYPE_RSA_PRIVATE LENGTH_RSA_4096;no;
TYPE_RSA_PRIVATE_TRANSIENT_RESET;no;
TYPE_RSA_PRIVATE_TRANSIENT_DESELECT;no;
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_512;yes;0.048000
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_736;yes;0.051000
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_768;yes;0.052000
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_896;yes;0.051000
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_1024;yes;0.054000
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_1280;yes;0.056000
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_1536;yes;0.057000
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_1984;yes;0.059000
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_2048;yes;0.058000
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_3072;no;
TYPE_RSA_CRT_PRIVATE LENGTH_RSA_4096;no;
TYPE_RSA_CRT_PRIVATE_TRANSIENT_RESET;no;
TYPE_RSA_CRT_PRIVATE_TRANSIENT_DESELECT;no;
TYPE_DSA_PRIVATE LENGTH_DSA_512;no;
TYPE_DSA_PRIVATE LENGTH_DSA_768;no;
TYPE_DSA_PRIVATE LENGTH_DSA_1024;no;
TYPE_DSA_PRIVATE_TRANSIENT_RESET;no;
TYPE_DSA_PRIVATE_TRANSIENT_DESELECT;no;
TYPE_DSA_PUBLIC LENGTH_DSA_512;no;
TYPE_DSA_PUBLIC LENGTH_DSA_768;no;
TYPE_DSA_PUBLIC LENGTH_DSA_1024;no;
TYPE_EC_F2M_PRIVATE LENGTH_EC_F2M_113;no;
TYPE_EC_F2M_PRIVATE LENGTH_EC_F2M_131;no;
TYPE_EC_F2M_PRIVATE LENGTH_EC_F2M_163;no;
TYPE_EC_F2M_PRIVATE LENGTH_EC_F2M_193;no;
TYPE_EC_F2M_PRIVATE_TRANSIENT_RESET;no;
TYPE_EC_F2M_PRIVATE_TRANSIENT_DESELECT;no;
TYPE_EC_FP_PRIVATE LENGTH_EC_FP_112;no;
TYPE_EC_FP_PRIVATE LENGTH_EC_FP_128;no;
TYPE_EC_FP_PRIVATE LENGTH_EC_FP_160;yes;0.049000
TYPE_EC_FP_PRIVATE LENGTH_EC_FP_192;yes;0.054000
TYPE_EC_FP_PRIVATE LENGTH_EC_FP_224;yes;0.054000
TYPE_EC_FP_PRIVATE LENGTH_EC_FP_256;yes;0.051000
TYPE_EC_FP_PRIVATE LENGTH_EC_FP_384;yes;0.055000
TYPE_EC_FP_PRIVATE LENGTH_EC_FP_521;yes;0.059000
TYPE_EC_FP_PRIVATE_TRANSIENT_RESET;no;
TYPE_EC_FP_PRIVATE_TRANSIENT_DESELECT;no;
TYPE_KOREAN_SEED_TRANSIENT_RESET;yes;0.058000
TYPE_KOREAN_SEED_TRANSIENT_DESELECT;yes;0.084000
TYPE_KOREAN_SEED LENGTH_KOREAN_SEED_128;yes;0.046000
TYPE_HMAC_TRANSIENT_RESET;no;
TYPE_HMAC_TRANSIENT_DESELECT;no;
TYPE_HMAC LENGTH_HMAC_SHA_1_BLOCK_64;no;
TYPE_HMAC LENGTH_HMAC_SHA_256_BLOCK_64;no;
TYPE_HMAC LENGTH_HMAC_SHA_384_BLOCK_64;no;
TYPE_HMAC LENGTH_HMAC_SHA_512_BLOCK_64;no;

javacard.security.KeyAgreement
ALG_EC_SVDP_DH/ALG_EC_SVDP_DH_KDF;yes;0.033000
ALG_EC_SVDP_DHC/ALG_EC_SVDP_DHC_KDF;yes;0.034000
ALG_EC_SVDP_DH_PLAIN;yes;0.034000
ALG_EC_SVDP_DHC_PLAIN;yes;0.035000
ALG_EC_PACE_GM;yes;0.013000
ALG_EC_SVDP_DH_PLAIN_XY;yes;0.013000
ALG_DH_PLAIN;yes;0.012000

javacard.security.Checksum
ALG_ISO3309_CRC16;yes;0.034000
ALG_ISO3309_CRC32;yes;0.035000

javacard.security.KeyPair ALG_RSA on-card generation
ALG_RSA LENGTH_RSA_512;yes;1.318000
ALG_RSA LENGTH_RSA_736;yes;1.428000
ALG_RSA LENGTH_RSA_768;yes;0.718000
ALG_RSA LENGTH_RSA_896;yes;2.718000
ALG_RSA LENGTH_RSA_1024;yes;3.514000
ALG_RSA LENGTH_RSA_1280;yes;13.239000
ALG_RSA LENGTH_RSA_1536;yes;17.424000
ALG_RSA LENGTH_RSA_1984;yes;16.201000
ALG_RSA LENGTH_RSA_2048;yes;13.643000
ALG_RSA LENGTH_RSA_3072;no;
ALG_RSA LENGTH_RSA_4096;no;

javacard.security.KeyPair ALG_RSA_CRT on-card generation
ALG_RSA_CRT LENGTH_RSA_512;yes;1.644000
ALG_RSA_CRT LENGTH_RSA_736;yes;0.536000
ALG_RSA_CRT LENGTH_RSA_768;yes;1.088000
ALG_RSA_CRT LENGTH_RSA_896;yes;3.420000
ALG_RSA_CRT LENGTH_RSA_1024;yes;4.805000
ALG_RSA_CRT LENGTH_RSA_1280;yes;11.913000
ALG_RSA_CRT LENGTH_RSA_1536;yes;17.009000
ALG_RSA_CRT LENGTH_RSA_1984;yes;10.609000
ALG_RSA_CRT LENGTH_RSA_2048;yes;9.201000
ALG_RSA_CRT LENGTH_RSA_3072;no;
ALG_RSA_CRT LENGTH_RSA_4096;no;

javacard.security.KeyPair ALG_DSA on-card generation
ALG_DSA LENGTH_DSA_512;no;
ALG_DSA LENGTH_DSA_768;no;
ALG_DSA LENGTH_DSA_1024;no;

javacard.security.KeyPair ALG_EC_F2M on-card generation
ALG_EC_F2M LENGTH_EC_F2M_113;no;
ALG_EC_F2M LENGTH_EC_F2M_131;no;
ALG_EC_F2M LENGTH_EC_F2M_163;no;
ALG_EC_F2M LENGTH_EC_F2M_193;no;

javacard.security.KeyPair ALG_EC_FP on-card generation
ALG_EC_FP LENGTH_EC_FP_112;no;
ALG_EC_FP LENGTH_EC_FP_128;no;
ALG_EC_FP LENGTH_EC_FP_160;yes;0.816000
ALG_EC_FP LENGTH_EC_FP_192;yes;0.911000
ALG_EC_FP LENGTH_EC_FP_224;yes;1.079000
ALG_EC_FP LENGTH_EC_FP_256;yes;1.220000
ALG_EC_FP LENGTH_EC_FP_384;yes;2.016000
ALG_EC_FP LENGTH_EC_FP_521;yes;3.566000

Support for variable public exponent for RSA 1024. If supported, user-defined fast modular exponentiation can be executed on the smart card via cryptographic coprocessor. This is very specific feature and you will probably not need it;
Allocate RSA 1024 objects;yes;0.134000 sec;
Set random modulus;yes;0.038000 sec;
Set random public exponent;yes;1.212000 sec;
Initialize cipher with public key with random exponent;yes;0.334000 sec;
Use random public exponent;yes;0.125000 sec;

Total test time:; 166 seconds.

0 comments on commit 20e8207

Please sign in to comment.