The jCardSim implementation of methods to get parameters like the modulus or public exponent of an RSA key return the index of the byte after the copied value.
This is consistent with many other javacard APIs, like Util.arrayCopy(). Unfortunately, it is incorrect.
These methods are specified to return "the byte length of the modulus value returned." In other words, they result in the number of bytes copied to the array, not an offset into the array. These methods produce incorrect results with a non-zero offset argument.
From erick...@bitflash.net on September 13, 2013 03:05:06
The jCardSim implementation of methods to get parameters like the modulus or public exponent of an RSA key return the index of the byte after the copied value.
This is consistent with many other javacard APIs, like Util.arrayCopy(). Unfortunately, it is incorrect.
These methods are specified to return "the byte length of the modulus value returned." In other words, they result in the number of bytes copied to the array, not an offset into the array. These methods produce incorrect results with a non-zero offset argument.
Original issue: http://code.google.com/p/jcardsim/issues/detail?id=14