OpenCryptoProject / JCMathLib

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

Problem Using `INS_BN_EXP_MOD` with simulator #30

Closed mjalaliwallex closed 1 year ago

mjalaliwallex commented 1 year ago

I am trying to use modular exponentiation for two big numbers in JCIDE simulator. I have run the test code and try to calculate:

a = e39de17291bce3c29354424b959f330cbce9cab40c3f7c76fd4fdd8fc31ff553 b = 9ec03b35bc2f449ecd4e16724320d9df17f18cd5f04dbe441d16c2343ef002f3 c = 1669c4b9e5a03f1382f661beaf89b1ff451dd65a2a0aaf192765d78011d2b345 a^b mod c

I send APDU below: <<B0 33 20 20 60 E3 9D E1 72 91 BC E3 C2 93 54 42 4B 95 9F 33 0C BC E9 CA B4 0C 3F 7C 76 FD 4F DD 8F C3 1F F5 53 9E C0 3B 35 BC 2F 44 9E CD 4E 16 72 43 20 D9 DF 17 F1 8C D5 F0 4D BE 44 1D 16 C2 34 3E F0 02 F3 16 69 C4 B9 E5 A0 3F 13 82 F6 61 BE AF 89 B1 FF 45 1D D6 5A 2A 0A AF 19 27 65 D7 80 11 D2 B3 45

but I get an exception F1 01 what am I doing wrong?