OpenCryptoProject / JCMathLib

Implementation of mathematical operations with big numbers and elliptic curve points for smart cards with JavaCard platform.
MIT License
83 stars 27 forks source link

Add function for primality testing #10

Open petrs opened 4 years ago

mavroudisv commented 4 years ago

I'm interested. I could implement it this or the coming week.

Are we aware of any methods checking the primality of their input parameters? I think that would be the optimal way of doing it.

For example, the setFieldFP() seems to be a good candidate:

https://docs.oracle.com/javacard/3.0.5/api/javacard/security/ECKey.html#setFieldFP(byte[],%20short,%20short)

I believe we are already using this method, so it won't introduce new API dependencies.