JCMathLib icon indicating copy to clipboard operation
JCMathLib copied to clipboard

Inquiry about JCmathlib Support for JavaCard 3.0.4

Open emvuys opened this issue 1 year ago • 3 comments

I have written a JavaCard application and configured the card as JCOP3_P60, which supports JCDK 3.0.4. However, I faced issues when testing with the card, particularly because I noticed that JCmathlib uses ALG_EC_SVDP_DH_PLAIN_XY and ALG_EC_PACE_GM parameters.

The card in version 3.0.5 is working properly.

Could you please clarify if JCmathlib supports JavaCard 3.0.4 cards, or if there are any specific modifications required to achieve compatibility?

emvuys avatar Jul 05 '24 09:07 emvuys

Dear @emvuys ALG_EC_SVDP_DH_PLAIN_XY and ALG_EC_PACE_GM algorithms are not available in JCAPI 3.0.4 so we cannot use them if your card supports JCAPI only up to 3.0.4 (which is the case for NXP JCOP3 P60). So if you have card with support of 3.0.5 or higher, these algorithms are available to JCMathLib, otherwise they need to be emulated by significantly slower code or not supported. Look at https://www.fi.muni.cz/~xsvenda/jcalgtest/table.html to see what your card is supporting as set constants accordingly.

petrs avatar Jul 05 '24 12:07 petrs

@petrs Thank you very much for your prompt response. The 3.0.4 card I tested is not on the list, but I am certain it is version 3.0.4. If slow card processing is acceptable, how does JCmathlib support version 3.0.4 cards? Thank you again for your response.

emvuys avatar Jul 06 '24 03:07 emvuys

Hi @emvuys, NXP JCOP3 P60 is a bit special. Although it fully supports only JavaCard API 3.0.4, it can already run some algorithms added in JavaCard API 3.0.5 and we use this in its configuration in OperationSupport.

To run JCMathLib on a different 3.0.4 card, I would recommend the following approach. First, try running tests with a configuration of the older smartcards, e.g. , JCOP21 or GD70 and check if the tests passed. If not, define a new constant for your card and try varying the available options one by one until more tests pass. If you are successful, we would welcome a PR with your configuration.

However, before you do any of the described steps, be aware that certain configurations may block your card!

dufkan avatar Jul 10 '24 16:07 dufkan