-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
re-export curve25519-dalek features #453
Comments
Hm, interesting. I was going to say you can specify this manually in Cargo.toml or in the command line, but that would only work if you could turn off the default |
thank you @jrose-signal. As you point out, features can be specified at the command line or in Cargo.toml - but only in code with a direct dependency on curve25519-dalek. It is my understanding that libsignal-client must re-export these features for them to be available to subsequent dependents. Also, AFAIK I am working to build a Signal client for the 32 bit Precursor hardware. This mobile device captured my attention with its claim of verifyable hardware. Precursor is powered by an FPGA-hosted, soft-core System-on-Chip (SoC), which means that the CPU may be verified and compiled from design source with no hidden instructions or other backdoors. Signal seems to me to be an important App to have on such a device. |
While working thru other dependencies for the Precursor project I note that both zkgroup and poksho re-export the required features.
|
Perhaps this should be raised as a separate issue (?) but it is closely related. As features
|
So honestly, I would say this is a problem in Anyway, I feel like we should find a solution upstream and fix the build system in Some suggestions for a patch to curve25519:
Whichever solution you choose, you can use a Finally, I'd like to cc @hdevalence for their thoughts on this matter. |
@jrose-signal I ran some local tests on the behaviour of libsignal-client/rust/protocol/Cargo.toml
|
Yeah. I think zkgroup and poksho cribbed their feature re-exporting from other crates that did this, but from libsignal-client's perspective (and zkgroup's, and poksho's) it's really an implementation detail; if we re-exported the features but changed to some other curve25519 implementation, they would no longer make sense.
Within Signal's repository that's handled by a |
Indeed, if there were no-longer a
So I am missing something important here. I can use the |
I only recommend getting rid of the feature flag, I don't recommend getting rid of the implementation. It probably has a place (and indeed is probably faster than the u64 on certain/most 32-bit CPUs). The only thing we are trying to convey here, is that the specific use of the feature flags here is non-idiomatic and should be considered "a flaw" in the design of Curve25519-dalek.
I don't see why not. It just uses |
Quick benchmarks of variable base scalar mult in curve25519-dalek-ng, in cooperation with @thvdveld, because you now nerd-sniped us.
Thibaut does say he doesn't trust the cycle counter 100%, but at least it works and is kinda fast :-) These things are clocked on 32MHz, so that's something like 14 ms.
... I honestly did not expect this, and this does give me also an incentive to have the u32 backend for Whisperfish/Presage... 90% of our user base is on such a setup. I would add a bench on a Raspberry Pi 4 on aarch64, but I have to go home now :-) |
That's startling, we (Signal) should probably test that for 32-bit Android as well. |
If you/us are going to patch curve25519-dalek, it might also be useful to switch to curve25519-dalek-ng. |
…erly The problem is that the default is curve25519-dalek/u64_backend and that features can only be selected by a direct dependent (libsignal-client in this case) This limitation can be overcome if libsignal-client were to re-export the features of interest. And then the same for libsignal-service-r and presage. This has been effected with local copies of the repos A request has been raised with Signal to rectify signalapp/libsignal#453 This is frustrated by the inability of a patch to propogate a feature selection Also command line option --no-default-features is similarly limited, and does not flow thru to dependencies. So in this case each dependency must also include default-features = false to de-select the default u64_backend.
Could you explain why we should not use the original curve25519-dalek crate ? Because of the Dalek Github organization takeover ? as I can see, there has been no problem with this crate since it happened, and they both (dalek and zkcrypto) look like they are not actively maintained (last update 7 months ago, with pending pull requests), so I was wondering... |
Well, at the time, the zkgroup fork seemed more active, and it received some attention back then. Ultimately, it doesn't really seem to matter at this point. Getting the lizard2 code out in one of those repos would be nice, however. I might give that a shot at some point, just to clean things up. I'm maintaining forks for Whisperfish, and now forks of forks of forks for benchmarking our neon code on Sailfish devices. 🤷♂️ |
Closing this since curve25519-dalek is maintained again (by folks from RustCrypto). Tying up some loose ends:
|
Would it be possible for libsignal-client/Cargo.toml to re-export curve25519-dalek features?
nightly = [curve25519-dalek/nightly]
default = [curve25519-dalek/default]
std = [curve25519-dalek/std]
alloc = [curve25519-dalek/alloc]
u32_backend = [curve25519-dalek/u32_backend]
u64_backend = [curve25519-dalek/u64_backend]
simd_backend = [curve25519-dalek/simd_backend]
In particular I am seeking std and u32_backend - and include the others for sake of completeness.
The text was updated successfully, but these errors were encountered: