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

Investigate the JS React native code interoperability. #1388

Open
3 tasks
lucanicoladebiasi opened this issue Oct 4, 2024 · 3 comments
Open
3 tasks

Investigate the JS React native code interoperability. #1388

lucanicoladebiasi opened this issue Oct 4, 2024 · 3 comments

Comments

@lucanicoladebiasi
Copy link
Collaborator

lucanicoladebiasi commented Oct 4, 2024

Investigate the possibility of JS using the SDK running in React to call native executable code.

This case is useful to provide hight speed and secure cryptographic support to runtimes unable to detect the crypo layer provided by NodeJS to delegate cryptographic functions to the host OS. Failure to recognize the cryptographic API provided by the OS obliges the SDK to perform computations in JS runtime resulting execution delays of tens of seconds compared to the ms when the same functions are delegated to the hardware through the host OS.

Acceptance criteria:

  • Investigate how to achieve it
  • Document how to do it
  • Create an executable example
@lucanicoladebiasi
Copy link
Collaborator Author

This ticket follows up #1334.

@lucanicoladebiasi
Copy link
Collaborator Author

lucanicoladebiasi commented Nov 24, 2024

I'm investigating the new architecture described at NodeJS 23 - The new architecture is here, it promises to simplify the React calling native code interoperability.

:) Luca

@lucanicoladebiasi
Copy link
Collaborator Author

lucanicoladebiasi commented Nov 25, 2024

The deprecation of keythereum shows the suggestion to move out cryptographic functionalities from JS runtime is gaining popularity. By design V8 and NodeJS provide API to observe and debug heap memory, the worker tasks model leave objects in heap for unpredictable time, as explained in the Learning fast elliptic-curve cryptography - State of cryptography in JS for JS runtime it's impossible to reduce the surface of attach as it is possible running native code.

It doesn't exist a generic model to call native code from JS, nevertheless, React provides one that is the subject of this ticket.

NodeJS provides its solution with C++ addon, this should be investigated as well.

I wonder if a simpler and more generic solution to let the SDK to use native cryptographic functionalities is to provide native functionalities for the different OS - Android, iOS, Linux, MacOS and Windows - as microserver connected via SSL or REST HTTPS with the JS runtime.

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

No branches or pull requests

2 participants