JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html
https://ftsafe.en.alibaba.com/index.html
How to make integer variable on JavaCard 2.2.2?
How to make integer variable on JavaCard 2.2.2?
As far as I know, there is no integer variable on JavaCard 2.2.2. Am I right? I am developing an applet which needs int variable and four basic arithmetic operations + - * / .
I want to know how to make the int variable and process the four basic arithmetic operations. Any help? I am much appreciated!
I want to know how to make the int variable and process the four basic arithmetic operations. Any help? I am much appreciated!
- UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3055
- Contact:
Re: How to make integer variable on JavaCard 2.2.2?
The card need to support JCint.
For your applet compatibility, implement JCint yourself in your applet.
Currently issued cards support JCint generally, few are not support.
For your applet compatibility, implement JCint yourself in your applet.
Currently issued cards support JCint generally, few are not support.
sense and simplicity
Re: How to make integer variable on JavaCard 2.2.2?
Just a heads up that JCMathLib also provides an Integer class. 

Re: How to make integer variable on JavaCard 2.2.2?
There is no direct way when using the API. The answer that JCInt is generally supported is complete bollocks, most cards won't support the int type after all. One option is to use a generic BigNum library such as JCMathLib (which operates on any sized number). If you are lucky then BigNum support is build in using the BigNumber API. I would not count on availability for generic cards though.
It is of course also possible to program it yourself - to a certain degree. Which is exactly what I did in my JCInteger class posted on StackOverflow, link here. Note that the multiplication, division and remainder ops are not things that are easy to program efficiently. Even with this highly optimized code, you will want to avoid using the class - use short where you can. It does require some awkward juggling with types, as any object is in EEPROM for Java Card.
It is of course also possible to program it yourself - to a certain degree. Which is exactly what I did in my JCInteger class posted on StackOverflow, link here. Note that the multiplication, division and remainder ops are not things that are easy to program efficiently. Even with this highly optimized code, you will want to avoid using the class - use short where you can. It does require some awkward juggling with types, as any object is in EEPROM for Java Card.
Re: How to make integer variable on JavaCard 2.2.2?
Excellent topic. I learned a lot. Thank you very much for sharing.
https://crbtech.in/online-java-training-course
https://crbtech.in/online-java-training-course
Who is online
Users browsing this forum: No registered users and 40 guests