Skip to content

Commit e1794f2

Browse files
committed
don't use cpuid-bool in fortanix sgx target
1 parent afc167f commit e1794f2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

sha2/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ opaque-debug = "0.3"
2121
cfg-if = "0.1"
2222
sha2-asm = { version = "0.5", optional = true }
2323

24-
[target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies]
24+
[target.'cfg(all(any(target_arch = "x86", target_arch = "x86_64"), not(target_env = "sgx")))'.dependencies]
2525
cpuid-bool = "0.1"
2626

2727
[target.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.dependencies]

sha2/src/sha256/x86.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ unsafe fn digest_blocks(state: &mut [u32; 8], blocks: &[[u8; 64]]) {
9595
_mm_storeu_si128(state_ptr_mut.add(1), hgef);
9696
}
9797

98+
#[cfg(feature = "cpuid_bool")]
9899
pub fn compress(state: &mut [u32; 8], blocks: &[[u8; 64]]) {
99100
// TODO: Replace with https://github.com/rust-lang/rfcs/pull/2725
100101
// after stabilization
@@ -106,3 +107,8 @@ pub fn compress(state: &mut [u32; 8], blocks: &[[u8; 64]]) {
106107
super::soft::compress(state, blocks);
107108
}
108109
}
110+
111+
#[cfg(not(feature = "cpuid_bool"))]
112+
pub fn compress(state: &mut [u32; 8], blocks: &[[u8; 64]]) {
113+
super::soft::compress(state, blocks);
114+
}

0 commit comments

Comments
 (0)