Replies: 1 comment
-
Are there any updates or future plans regarding how you intend to address this issue? It seems that the problem lies more with the dependency on libsodium-sys being deprecated rather than libsodium itself. Currently (June 2023), I am encountering two problems when attempting to cross-compile Stronghold (and consequently libsodium-sys) for Android and iOS Simulator. Download libsodium-sys and do the following: 1.) The iOS Simulator problem could be easily solved when the build.rs in libsodium-sys is extended after line 189:
2.) Android: I have no idea why this fails. I can manually create libsodium library BUT NOT via libsodium-sys. COULDN'T YOU FORK THE LIBSODIUM-SYS REPO AND MAINTAIN THE WRAPPER LIBRARY? |
Beta Was this translation helpful? Give feedback.
-
Binder API
)Summary
The current implementation of Stronghold is deeply integrated with libsodium.
Unfortunately sodiumoxide which is a port of libsodium on Rust has been deprecated which forces us to find a new solution
We propose a new runtime architecture in which memory management can have different implementations depending on the target platform.
Motivation
Libsodium is deeply rooted in the current implementation since we directly use the sodiumoxide crate in our code.
While it is really practical it also means that we force our users to rely on libsodium.
The main drawback is that we cannot support any platform which is also not supported by libsodium.
Hence it's really difficult for a potential contributor to add support for an alternative to libsodium.
Explanation
The goal is to provide, to the Stronghold runtime, some low level functions to manage the memory.
Currently this part is done by calling sodiumoxide directly.
We propose an API containing these low-level functions which implementation will depend on the target platform.
We call this API the
Binder
.Functions of the
Binder
are totally taken from libsodium and libc and are:At first these functions implementations will either be direct calls to libsodium or code taken from libsodium.
However with this architecture we will be easily be able to add code for platforms we currently don't support.
The implementation chosen will be decided with compilation flags.
Drawbacks
Rationale
Binder
interface to provide support for a new platformDiscussions
How do we replace sodiumoxide? 3 options:
Currently the last option seems the more attractive since it would allow us to improve on libsodium by adding ideas from MemGuard.
The downside is that we will need to support OS updates ourselves.
Future possibilities
This RFC is the first step towards having a HAL for Stronghold.
In the future adding support for new platforms will solely be located in the
Binder
part of the runtime.Beta Was this translation helpful? Give feedback.
All reactions