mirror of
https://github.com/luxfi/crypto.git
synced 2026-07-27 01:54:50 +00:00
Mirrors the consensus + node Corona purge. The production Ring-LWE threshold library is luxfi/corona; the threshold-scheme byte and all aggregator codepaths use the production identifier.
28 lines
1.3 KiB
Rust
28 lines
1.3 KiB
Rust
use std::env;
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
|
|
let base: PathBuf = if let Ok(d) = env::var("CRYPTO_DIR") {
|
|
PathBuf::from(d).join("lib")
|
|
} else if let Ok(d) = env::var("CRYPTO_BUILD_DIR") {
|
|
PathBuf::from(d)
|
|
} else {
|
|
manifest_dir.join("..").join("..").join("..").join("..")
|
|
.join("luxcpp").join("crypto").join("build")
|
|
};
|
|
println!("cargo:rerun-if-changed=src/lib.rs");
|
|
println!("cargo:rerun-if-env-changed=CRYPTO_DIR");
|
|
println!("cargo:rerun-if-env-changed=CRYPTO_BUILD_DIR");
|
|
let lamport_path = base.join("lamport");
|
|
let sha256_path = base.join("sha256");
|
|
println!("cargo:rustc-link-search=native={}", lamport_path.display());
|
|
println!("cargo:rustc-link-search=native={}", sha256_path.display());
|
|
println!("cargo:rustc-link-lib=static=lamport");
|
|
println!("cargo:rustc-link-lib=static=lamport_cpu");
|
|
// lamport::keygen/verify call cevm::crypto::sha256, which lives in
|
|
// libsha256_cpu (see luxcpp/crypto/sha256). Link it explicitly.
|
|
println!("cargo:rustc-link-lib=static=sha256_cpu");
|
|
if cfg!(target_os = "macos") { println!("cargo:rustc-link-lib=c++"); } else { println!("cargo:rustc-link-lib=stdc++"); }
|
|
}
|