@@ -137,3 +137,41 @@ mod sealed {
137
137
// ```
138
138
pub trait Sealed { }
139
139
}
140
+
141
+ /// # Information about using *ring* in SGX
142
+ ///
143
+ /// ## CPU feature detection
144
+ /// On `x86_64-fortanix-unknown-sgx`, feature detection is done using the
145
+ /// `std::is_x86_feature_detected` macro, which currently only supports
146
+ /// features enabled at compile-time. You must enable at least the `aes` and
147
+ /// `pclmul` features, otherwise *ring* will panic at runtime. See the [GitHub
148
+ /// issue](https://github.com/fortanix/rust-sgx/issues/26) for more
149
+ /// information.
150
+ ///
151
+ /// To set compile-time features, you can either specify them as an environment
152
+ /// variable:
153
+ ///
154
+ /// ```text
155
+ /// RUSTFLAGS="-C target-feature=+aes,+pclmul"
156
+ /// ```
157
+ ///
158
+ /// Or you may configure them per target in [`.cargo/config`].
159
+ ///
160
+ /// [`.cargo/config`]: https://doc.rust-lang.org/cargo/reference/config.html#configuration-keys
161
+ ///
162
+ /// ## Entropy source
163
+ /// The entropy source used in SGX is the hardware random number generator
164
+ /// provided by the RDRAND instruction.
165
+ ///
166
+ /// ## Nightly only
167
+ /// The `x86_64-fortanix-unknown-sgx` target is only available on nightly, and
168
+ /// *ring* Continuous Builds only build it for nightly. See the [GitHub
169
+ /// issue](https://github.com/briansmith/ring/issues/779) for more information.
170
+ ///
171
+ /// ## Continuous Testing
172
+ /// While the *ring* test suite works in SGX, and it is run manually from time
173
+ /// to time, it doesn't run automatically as part of a Continuous Testing
174
+ /// setup. See the [GitHub issue](https://github.com/briansmith/ring/issues/778)
175
+ /// for more information.
176
+ #[ cfg( target_env = "sgx" ) ]
177
+ pub mod sgx { }
0 commit comments