The next line of code lasts cca 420000 usec:
sigLen = cipher.doFinal(tmpBuffer.data, (short) 0, chainingLength, tmpBuffer.data,
(short) 0);
Cipher is the applet instance and it has been initialized in MODE_ENCRYPT mode of work. The cipher is defined like:
cipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1, false);
Does usec represent microsecond? I checked the specification JCOPV2_4_1R3_um and I saw something that surprised me. It says that the RSA encryption with the RSA key with the length 2048 but = 256 byte lasts 21 ms. What is happening? I checked several times and I am sure that this line is the bottleneck of the method execution. It would be the expected behavior only in situation if usec represents the millisecond instead microsecond.