You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The application works fine, however, when running the unit tests, I get the same result each time:
Gradle suite > Gradle test > tests.AppletTest.hello STANDARD_OUT
Connecting to card... Done.
--> [00C00000080000000000000000] 13
<-- 51373E8B6FDEC284DB569204CA13D2CAA23BD1D85DCAB02A0E3D50461E73F1BB 9000 (32)
ResponseAPDU: 34 bytes, SW=9000
Looking through the source code, I see that random.generateData is generating into tmpBuffer, then copied into the APDU buffer. As this is part of the process() function (which should be executed separately every time the tests are run), shouldn't the output be random? The implementation in jCardSim seems to be based off bouncycastle, so I would expect it to actually be random.
The text was updated successfully, but these errors were encountered:
The reason is the JCardSim uses a static seed for randomness generated by the RandomData API. I think the main reason is the test reproducibility. One can reseed the generator with another seed.
The application works fine, however, when running the unit tests, I get the same result each time:
Looking through the source code, I see that random.generateData is generating into tmpBuffer, then copied into the APDU buffer. As this is part of the process() function (which should be executed separately every time the tests are run), shouldn't the output be random? The implementation in jCardSim seems to be based off bouncycastle, so I would expect it to actually be random.
The text was updated successfully, but these errors were encountered: