@@ -12,7 +12,7 @@ Random number generators and other randomness functionality.
1212"""
1313keywords = [" random" , " rng" ]
1414categories = [" algorithms" , " no-std" ]
15- exclude = [" /utils/*" , " /.travis.yml" , " /appveyor.yml" , " .gitignore" ]
15+ exclude = [" /utils/*" , " /.travis.yml" , " /appveyor.yml" , " .gitignore" , " /sgx/* " ]
1616autobenches = true
1717edition = " 2018"
1818
@@ -21,20 +21,21 @@ travis-ci = { repository = "rust-random/rand" }
2121appveyor = { repository = " rust-random/rand" }
2222
2323[features ]
24+ default = [" std" , " mesalock_sgx" ] # without "std" rand uses libcore
2425# Meta-features:
25- default = [" std" ] # without "std" rand uses libcore
2626nightly = [" simd_support" ] # enables all features requiring nightly rust
2727serde1 = [] # does nothing, deprecated
2828
2929# Optional dependencies:
30- std = [" rand_core/std" , " rand_chacha/std" , " alloc " , " getrandom " , " libc " ]
30+ std = [" rand_core/std" , " rand_core/mesalock_sgx " , " rand_chacha/std" , " rand_chacha/mesalock_sgx " , " alloc " , " getrandom " ]
3131alloc = [" rand_core/alloc" ] # enables Vec and Box support (without std)
3232# re-export optional WASM dependencies to avoid breakage:
3333# Warning: wasm-bindgen and stdweb features will be removed in rand 0.8;
3434# recommended to activate via the getrandom crate instead.
35- wasm-bindgen = [" getrandom_package/wasm-bindgen" ]
36- stdweb = [" getrandom_package/stdweb" ]
35+ # wasm-bindgen = ["getrandom_package/wasm-bindgen"]
36+ # stdweb = ["getrandom_package/stdweb"]
3737getrandom = [" getrandom_package" , " rand_core/getrandom" ]
38+ mesalock_sgx = [" sgx_tstd" ]
3839
3940# Configuration:
4041simd_support = [" packed_simd" ] # enables SIMD support
@@ -47,7 +48,7 @@ members = [
4748 " rand_chacha" ,
4849 " rand_hc" ,
4950 " rand_pcg" ,
50- " tests/wasm_bindgen" ,
51+ # "tests/wasm_bindgen",
5152]
5253
5354[dependencies ]
@@ -56,8 +57,9 @@ rand_pcg = { path = "rand_pcg", version = "0.2", optional = true }
5657# Do not depend on 'getrandom_package' directly; use the 'getrandom' feature!
5758# This is a dependency because: we forward wasm feature flags
5859# This is renamed because: we need getrandom to depend on rand_core/getrandom
59- getrandom_package = { version = " 0.1.1" , package = " getrandom" , optional = true }
60- log = { version = " 0.4.4" , optional = true }
60+ getrandom_package = { git = " https://github.com/mesalock-linux/getrandom-sgx.git" , package = " getrandom" , optional = true }
61+ log = { git = " https://github.com/mesalock-linux/log-sgx.git" , optional = true }
62+ sgx_tstd = { version = " 1.0" , rev = " v1.1.0" , git = " https://github.com/apache/teaclave-sgx-sdk.git" , optional = true }
6163
6264[dependencies .packed_simd ]
6365# NOTE: so far no version works reliably due to dependence on unstable features
@@ -68,19 +70,20 @@ features = ["into_bits"]
6870
6971[target .'cfg(unix)' .dependencies ]
7072# Used for fork protection (reseeding.rs)
71- libc = { version = " 0.2.22" , optional = true , default-features = false }
73+ # SGX does not provide fork. No need for fork protection
74+ # libc = { version = "0.2.22", optional = true, default-features = false }
7275
7376# Emscripten does not support 128-bit integers, which are used by ChaCha code.
7477# We work around this by using a different RNG.
7578[target .'cfg(not(target_os = "emscripten"))' .dependencies ]
7679rand_chacha = { path = " rand_chacha" , version = " 0.2.1" , default-features = false }
77- [target .'cfg(target_os = "emscripten")' .dependencies ]
78- rand_hc = { path = " rand_hc" , version = " 0.2" }
80+ # [target.'cfg(target_os = "emscripten")'.dependencies]
81+ # rand_hc = { path = "rand_hc", version = "0.2" }
7982
8083[dev-dependencies ]
81- rand_pcg = { path = " rand_pcg" , version = " 0.2" }
84+ # rand_pcg = { path = "rand_pcg", version = "0.2" }
8285# Only for benches:
83- rand_hc = { path = " rand_hc" , version = " 0.2" }
86+ # rand_hc = { path = "rand_hc", version = "0.2" }
8487
8588[package .metadata .docs .rs ]
8689all-features = true
0 commit comments