1010//! convenient.
1111//!
1212//! [isdm]: https://www-ssl.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html
13- #![ cfg_attr( feature = "nightly" , feature( llvm_asm) ) ]
14-
1513#![ no_std]
1614#![ doc( html_logo_url = "https://edp.fortanix.com/img/docs/edp-logo.svg" ,
1715 html_favicon_url = "https://edp.fortanix.com/favicon.ico" ,
@@ -30,9 +28,9 @@ extern crate serde;
3028#[ cfg( feature = "serde" ) ]
3129use serde:: { Serialize , Deserialize } ;
3230
33- #[ cfg( all( feature = "sgxstd " , target_env = "sgx " ) ) ]
31+ #[ cfg( all( target_env = "sgx " , feature = "sgxstd " ) ) ]
3432use std:: os:: fortanix_sgx:: arch;
35- #[ cfg( all( feature = "nightly" , target_env = "sgx" , not( feature = "sgxstd" ) ) ) ]
33+ #[ cfg( all( target_env = "sgx" , not( feature = "sgxstd" ) ) ) ]
3634mod arch;
3735use core:: { convert:: TryFrom , num:: TryFromIntError , slice} ;
3836
@@ -225,9 +223,7 @@ macro_rules! struct_def {
225223 } ;
226224 ( @align bytes $( $other: tt) * ) => { } ;
227225 ( @align type $ty: ident name $name: ident) => {
228- #[ cfg( all( feature = "sgxstd" , target_env = "sgx" ) ) ]
229- /// **Note.** This implementation is only available on the SGX target
230- /// with the `sgxstd` feature.
226+ #[ cfg( target_env = "sgx" ) ]
231227 impl AsRef <arch:: $ty<[ u8 ; $name:: UNPADDED_SIZE ] >> for $name {
232228 fn as_ref( & self ) -> & arch:: $ty<[ u8 ; $name:: UNPADDED_SIZE ] > {
233229 unsafe {
@@ -678,7 +674,7 @@ impl Report {
678674 ///
679675 /// let targetinfo_self = Targetinfo::from(Report::for_self());
680676 /// ```
681- #[ cfg( all ( feature = "sgxstd" , target_env = "sgx" ) ) ]
677+ #[ cfg( target_env = "sgx" ) ]
682678 pub fn for_self ( ) -> Self {
683679 let reportdata = arch:: Align128 ( [ 0 ; 64 ] ) ;
684680 let targetinfo = arch:: Align512 ( [ 0 ; 512 ] ) ;
@@ -687,7 +683,7 @@ impl Report {
687683 Report :: try_copy_from ( & out. 0 ) . unwrap ( )
688684 }
689685
690- #[ cfg( all ( feature = "sgxstd" , target_env = "sgx" ) ) ]
686+ #[ cfg( target_env = "sgx" ) ]
691687 pub fn for_target ( targetinfo : & Targetinfo , reportdata : & [ u8 ; 64 ] ) -> Report {
692688 let reportdata = arch:: Align128 ( * reportdata) ;
693689 let out = arch:: ereport ( targetinfo. as_ref ( ) , & reportdata) ;
@@ -700,7 +696,7 @@ impl Report {
700696 ///
701697 /// Care should be taken that `check_mac` prevents timing attacks,
702698 /// in particular that the comparison happens in constant time.
703- #[ cfg( all ( feature = "sgxstd" , target_env = "sgx" ) ) ]
699+ #[ cfg( target_env = "sgx" ) ]
704700 pub fn verify < F , R > ( & self , check_mac : F ) -> R
705701 where
706702 F : FnOnce ( & [ u8 ; 16 ] , & [ u8 ; Report :: TRUNCATED_SIZE ] , & [ u8 ; 16 ] ) -> R ,
@@ -781,7 +777,7 @@ pub struct Keyrequest {
781777impl Keyrequest {
782778 pub const UNPADDED_SIZE : usize = 512 ;
783779
784- #[ cfg( all ( feature = "sgxstd" , target_env = "sgx" ) ) ]
780+ #[ cfg( target_env = "sgx" ) ]
785781 pub fn egetkey ( & self ) -> Result < [ u8 ; 16 ] , ErrorCode > {
786782 match arch:: egetkey ( self . as_ref ( ) ) {
787783 Ok ( k) => Ok ( k. 0 ) ,
0 commit comments