Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get add JCMathLib to work with two ECPoints #25

Open
JFBB opened this issue Nov 17, 2022 · 1 comment
Open

Can't get add JCMathLib to work with two ECPoints #25

JFBB opened this issue Nov 17, 2022 · 1 comment

Comments

@JFBB
Copy link

JFBB commented Nov 17, 2022

Hello, I downloaded the latest version of JCMathLib and got the below errors.
I then downloaded the latest release (JCMathLib 1.1.0) and got the same result.

I need to be able to add two public keys (BrainpoolP256R1) and read the result. Can you help, please?

        ECConfig ecc = new ECConfig((short)256);
        ECCurve curve = new ECCurve(false, SecP256r1.p, SecP256r1.a, SecP256r1.b, SecP256r1.G, SecP256r1.r);
        ECPoint point1 = new ECPoint(curve, ecc.ech);
        ECPoint point2 = new ECPoint(curve, ecc.ech);
        point1.randomize(); 
        point2.randomize(); 
        point1.add(point2);

This gave a Crypto error.

I also tried

        ECConfig ecc = new ECConfig((short)256);
        ECCurve curve = new ECCurve(
                false,
                Brainpool256R1.getFp(),
                Brainpool256R1.getA(),
                Brainpool256R1.getB(),
                Brainpool256R1.getG(),
                Brainpool256R1.getR()
                );
        ECPoint point1 = new ECPoint(curve, ecc.ech);
        ECPoint point2 = new ECPoint(curve, ecc.ech);
        point1.setW(cryptoBuf, (short)0, hashLen);
        point2.setW(CA, (short)0, (short)CA.length);
        point1.add(point2);

This gave the same error.

@dufkan
Copy link
Member

dufkan commented Jul 3, 2023

Hi, on which card are you trying to use JCMathLib? Is it one of the cards on which JCMathLib has been tested? I would recommend using the new version of the library, Release 2.0., which extended its support to more cards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants