JCMathLib with newer versions of JCardSim fails to compute multiplication using the RSA trick correctly. Consequently, the computation of sqrt_FP gets stuck, as the computation enters an unbounded loop whose end condition depends on correct multiplication results.
Another issue with newer versions of JCardSim is that RSAPublicKey needs to be renewed in order to compute modular exponentiations correctly.
Lastly, point doubling on JCardSim via KeyAgreement fails (other values seem to work correctly).
This pull request avoids these issues by renewing the RSAPublicKey and using a pure software implementation of Bignat multiplication and ECPoint doubling when bIsSimulator flag is set.
JCMathLib with newer versions of JCardSim fails to compute multiplication using the RSA trick correctly. Consequently, the computation of
sqrt_FP
gets stuck, as the computation enters an unbounded loop whose end condition depends on correct multiplication results.Another issue with newer versions of JCardSim is that
RSAPublicKey
needs to be renewed in order to compute modular exponentiations correctly.Lastly, point doubling on JCardSim via KeyAgreement fails (other values seem to work correctly).
This pull request avoids these issues by renewing the
RSAPublicKey
and using a pure software implementation ofBignat
multiplication andECPoint
doubling whenbIsSimulator
flag is set.