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

Any plan to add the BN_MONT_CTX family of functions? #362

Open
hhanh00 opened this issue Mar 29, 2023 · 2 comments · May be fixed by #446
Open

Any plan to add the BN_MONT_CTX family of functions? #362

hhanh00 opened this issue Mar 29, 2023 · 2 comments · May be fixed by #446

Comments

@hhanh00
Copy link

hhanh00 commented Mar 29, 2023

I think they would help speed up some custom ECC functions.

@aido
Copy link
Contributor

aido commented Jan 20, 2024

I am having issue with this also.

Speculos fails to implement cx_mont_init2() and cx_mont_init() causing my app to crash during testing. I am sure that if my app had continued without crashing I would also find that Speculos does not implement cx_mont_mul() either.

It is quite an inconvenience not being able to test with Speculos the apps that use these functions.

The OpenSSL library that is part of Speculos comes with functions like BN_MONT_CTX_init() and BN_mod_mul_montgomery() that would help with fxing this issue.

@aido
Copy link
Contributor

aido commented Jan 22, 2024

It looks like someone has done some work on this already:

https://github.com/LedgerHQ/cylib/blob/master/wrappers/bolos/cy_wrap_fp_bolos.c

https://github.com/LedgerHQ/cylib/blob/master/tests/cy_test_mulmontgomery.c

Can some of this code be used for inspiration?

aido added a commit to aido/speculos that referenced this issue Jan 24, 2024
aido added a commit to aido/speculos that referenced this issue Jan 24, 2024
@aido aido linked a pull request Jan 24, 2024 that will close this issue
aido added a commit to aido/speculos that referenced this issue Jan 24, 2024
aido added a commit to aido/speculos that referenced this issue Jan 24, 2024
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

Successfully merging a pull request may close this issue.

2 participants