Comments (3)
One hack (mentioned in the Cargo issue and in the u128 tracking issue) is to use a #[cfg]s in a build script to emit feature selections for the main crate.
build.rs gets always compiled for the host platform but has to create programs for the target platform. If the two platforms are different (in a cross compilation scenario), the platform build.rs gets built for is different from the platform it has to build stuff for. So don't use #[cfg]
or cfg!
in build.rs for that purpose. Instead, build.rs has the TARGET
env var.
from curve25519-dalek.
It seems like the "optimal" thing to do would be something like the following:
- Allow explicit backend selection with
u32
,u64
,avx2
features; - If no backend feature is specified,
build.rs
looks at theTARGET
env var and makes a best-guess about which backend to use, then emits that feature for the main compilation.
However, because we load the entire crate into the build.rs
already in order to generate constants using crate-private code, we need to have already selected the target backend before compiling the build script. So the approach above won't work. But this seems like the only way to access crate-private code without exposing it to the public.
from curve25519-dalek.
The current status is that the u64
backend is used by default, and that all backends are selectable with features.
Ideally we would auto-select the backend, but for the reasons described above we can't currently do this.
from curve25519-dalek.
Related Issues (20)
- Build fails on nightly-2024-02-05 HOT 2
- Crate fails with `nightly-2024-02-06` HOT 3
- How to check a VerifyingKey point is within the prime order subgroup HOT 3
- Support NIST validation criteria for Edwards points HOT 2
- ed25519: support PKCS#8 v1 (for OpenSSL interop)? HOT 2
- Use of unstable library feature 'stdsimd HOT 6
- Use of unstable library feature 'stdsimd' HOT 3
- Incorrect use of cfg to import dependency HOT 1
- docs.rs homepage examples use `rand_core` crate option, but do not mention its existence HOT 2
- [docs request] how to serialize a public key in the format compatible with `~/.ssh/authorized_keys`? HOT 2
- AVX512-IFMA & AVX10 status
- curve25519: nightly CI seems borked w/ warn(unused_imports)
- Impl std::num_traits::{One, Zero} for Scalar types
- Zeroize `SecretKey` on drop HOT 5
- Potential optimization for the torsion check HOT 1
- 4.1.3 release? HOT 4
- Implementation of ed25519-dalek::VerifyingKey::verify_strict seemingly inconsistent with documentation
- Verifying signatures using ZIP215 criteria
- Hard to use API for raw_sign_prehashed, I want to pass a 64 byte message hash HOT 1
- Add the ability to convert `[u8; 32]` into a `VerifyingKey` HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curve25519-dalek.