Skip to content

Commit 6bae2e4

Browse files
committed
Port to sgx 1.1.0
1 parent 7f3080b commit 6bae2e4

File tree

31 files changed

+401
-101
lines changed

31 files changed

+401
-101
lines changed

.drone.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
kind: pipeline
2+
name: hashes-sgx-xargo-1604-release
3+
4+
steps:
5+
- name: release-compile
6+
image: baiduxlab/sgx-rust:1604-1.1.0
7+
commands:
8+
- . /opt/sgxsdk/environment
9+
- . /root/.cargo/env
10+
- RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx --release
11+
12+
---
13+
14+
kind: pipeline
15+
name: hashes-sgx-xargo-1604-debug
16+
17+
steps:
18+
- name: debug-compile
19+
image: baiduxlab/sgx-rust:1604-1.1.0
20+
commands:
21+
- . /opt/sgxsdk/environment
22+
- . /root/.cargo/env
23+
- RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx
24+
25+
---
26+
27+
kind: pipeline
28+
name: hashes-sgx-xargo-1804-release
29+
30+
steps:
31+
- name: release-compile
32+
image: baiduxlab/sgx-rust:1804-1.1.0
33+
commands:
34+
- . /opt/sgxsdk/environment
35+
- . /root/.cargo/env
36+
- RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx --release
37+
38+
---
39+
40+
kind: pipeline
41+
name: hashes-sgx-xargo-1804-debug
42+
43+
steps:
44+
- name: debug-compile
45+
image: baiduxlab/sgx-rust:1804-1.1.0
46+
commands:
47+
- . /opt/sgxsdk/environment
48+
- . /root/.cargo/env
49+
- RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx
50+
51+
---
52+
53+
kind: pipeline
54+
name: hashes-sgx-1604-release
55+
56+
steps:
57+
- name: release-compile
58+
image: baiduxlab/sgx-rust:1604-1.1.0
59+
commands:
60+
- . /opt/sgxsdk/environment
61+
- . /root/.cargo/env
62+
- cargo build --release
63+
64+
---
65+
66+
kind: pipeline
67+
name: hashes-sgx-1604-hw-debug
68+
69+
steps:
70+
- name: debug-compile
71+
image: baiduxlab/sgx-rust:1604-1.1.0
72+
commands:
73+
- . /opt/sgxsdk/environment
74+
- . /root/.cargo/env
75+
- cargo build
76+
77+
---
78+
79+
kind: pipeline
80+
name: hashes-sgx-1804-release
81+
82+
steps:
83+
- name: release-compile
84+
image: baiduxlab/sgx-rust:1804-1.1.0
85+
commands:
86+
- . /opt/sgxsdk/environment
87+
- . /root/.cargo/env
88+
- cargo build --release
89+
90+
---
91+
92+
kind: pipeline
93+
name: hashes-sgx-1804-debug
94+
95+
steps:
96+
- name: debug-compile
97+
image: baiduxlab/sgx-rust:1804-1.1.0
98+
commands:
99+
- . /opt/sgxsdk/environment
100+
- . /root/.cargo/env
101+
- cargo build

.github/pull.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: "1"
2+
rules:
3+
- base: master
4+
upstream: RustCrypto:master
5+
mergeMethod: none

Xargo.toml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
[dependencies]
2+
alloc = {}
3+
4+
[dependencies.sgx_types]
5+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
6+
stage = 1
7+
8+
[dependencies.sgx_alloc]
9+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
10+
stage = 1
11+
12+
[dependencies.sgx_unwind]
13+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
14+
stage = 1
15+
16+
[dependencies.sgx_demangle]
17+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
18+
stage = 1
19+
20+
[dependencies.panic_abort]
21+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
22+
stage = 1
23+
24+
[dependencies.sgx_libc]
25+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
26+
stage = 2
27+
28+
[dependencies.sgx_tkey_exchange]
29+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
30+
stage = 2
31+
32+
[dependencies.sgx_tservice]
33+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
34+
stage = 2
35+
36+
[dependencies.sgx_tse]
37+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
38+
stage = 2
39+
40+
[dependencies.sgx_tcrypto]
41+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
42+
stage = 2
43+
44+
[dependencies.sgx_trts]
45+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
46+
stage = 3
47+
48+
[dependencies.sgx_backtrace_sys]
49+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
50+
stage = 3
51+
52+
[dependencies.panic_unwind]
53+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
54+
stage = 3
55+
56+
[dependencies.sgx_tdh]
57+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
58+
stage = 4
59+
60+
[dependencies.sgx_tseal]
61+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
62+
stage = 4
63+
64+
[dependencies.sgx_tprotected_fs]
65+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
66+
stage = 4
67+
68+
[dependencies.std]
69+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
70+
features = ["backtrace", "net"]
71+
stage = 5
72+
73+
[dependencies.sgx_no_tstd]
74+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
75+
stage = 5
76+
77+
[dependencies.sgx_rand]
78+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
79+
stage = 6
80+
81+
[dependencies.sgx_serialize]
82+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
83+
stage = 6
84+
85+
[dependencies.sgx_tunittest]
86+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
87+
stage = 6
88+
89+
[dependencies.sgx_backtrace]
90+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
91+
stage = 7
92+
93+
[dependencies.sgx_cov]
94+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
95+
stage = 7

blake2/Cargo.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,24 @@ keywords = ["crypto", "blake2", "hash", "digest"]
1010
categories = ["cryptography", "no-std"]
1111

1212
[dependencies]
13-
digest = "0.8"
14-
byte-tools = "0.3"
15-
crypto-mac = "0.7"
13+
digest = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
14+
byte-tools = { git = "https://github.com/mesalock-linux/rustcrypto-utils-sgx" }
15+
crypto-mac = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
1616
opaque-debug = "0.2"
17+
sgx_tstd = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
1718

1819
[dev-dependencies]
19-
digest = { version = "0.8", features = ["dev"] }
20-
crypto-mac = { version = "0.7", features = ["dev"] }
21-
hex-literal = "0.1"
20+
#digest = { version = "0.8", features = ["dev"] }
21+
#crypto-mac = { version = "0.7", features = ["dev"] }
22+
#hex-literal = "0.1"
2223

2324
[features]
24-
default = ["std"]
25-
std = ["digest/std", "crypto-mac/std"]
25+
default = ["std", "mesalock_sgx"]
26+
std = ["digest/std", "crypto-mac/std", "mesalock_sgx"]
2627
simd = []
2728
simd_opt = ["simd"]
2829
simd_asm = ["simd_opt"]
30+
mesalock_sgx = ["sgx_tstd"]
2931

3032
[badges]
3133
travis-ci = { repository = "RustCrypto/hashes" }

blake2/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,17 @@
9090

9191
#![cfg_attr(feature = "simd", feature(platform_intrinsics, repr_simd))]
9292
#![cfg_attr(feature = "simd_asm", feature(asm))]
93+
#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))]
9394

9495
#[macro_use] extern crate opaque_debug;
9596
#[macro_use] pub extern crate digest;
9697
extern crate byte_tools;
9798
pub extern crate crypto_mac;
9899

99-
#[cfg(feature = "std")]
100+
#[cfg(all(feature = "std", feature = "mesalock_sgx", target_env = "sgx"))]
100101
extern crate std;
102+
#[cfg(all(feature = "std", feature = "mesalock_sgx", not(target_env = "sgx")))]
103+
extern crate sgx_tstd as std;
101104

102105
mod consts;
103106
mod as_bytes;

gost94/Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@ keywords = ["crypto", "gost94", "gost", "hash", "digest"]
1010
categories = ["cryptography", "no-std"]
1111

1212
[dependencies]
13-
digest = "0.8"
14-
block-buffer = "0.7"
13+
digest = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
14+
block-buffer = { git = "https://github.com/mesalock-linux/rustcrypto-utils-sgx" }
1515
opaque-debug = "0.2"
16+
sgx_tstd = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
1617

1718
[dev-dependencies]
18-
digest = { version = "0.8", features = ["dev"] }
19-
hex-literal = "0.1"
19+
#digest = { version = "0.8", features = ["dev"] }
20+
#hex-literal = "0.1"
2021

2122
[features]
2223
default = ["std"]
23-
std = ["digest/std"]
24+
std = ["digest/std", "mesalock_sgx"]
25+
mesalock_sgx = ["sgx_tstd"]
2426

2527
[badges]
2628
travis-ci = { repository = "RustCrypto/hashes" }

gost94/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@
2828
//! [1]: https://en.wikipedia.org/wiki/GOST_(hash_function)
2929
//! [2]: https://github.com/RustCrypto/hashes
3030
#![no_std]
31+
#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))]
3132
#![doc(html_logo_url =
3233
"https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")]
3334
extern crate block_buffer;
3435
#[macro_use] pub extern crate digest;
3536
#[macro_use] extern crate opaque_debug;
36-
#[cfg(feature = "std")]
37+
38+
#[cfg(all(feature = "std", feature = "mesalock_sgx", target_env = "sgx"))]
3739
extern crate std;
40+
#[cfg(all(feature = "std", feature = "mesalock_sgx", not(target_env = "sgx")))]
41+
extern crate sgx_tstd as std;
3842

3943
#[macro_use]
4044
mod macros;

groestl/Cargo.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@ keywords = ["crypto", "groestl", "grostl", "hash", "digest"]
1010
categories = ["cryptography", "no-std"]
1111

1212
[dependencies]
13-
digest = "0.8"
14-
block-buffer = "0.7"
13+
digest = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
14+
block-buffer = { git = "https://github.com/mesalock-linux/rustcrypto-utils-sgx" }
1515
opaque-debug = "0.2"
16+
sgx_tstd = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
1617

1718
[dev-dependencies]
18-
digest = { version = "0.8", features = ["dev"] }
19-
hex-literal = "0.1"
19+
#digest = { version = "0.8", features = ["dev"] }
20+
#hex-literal = "0.1"
2021

2122
[features]
22-
default = ["std"]
23-
std = ["digest/std"]
23+
default = ["std", "mesalock_sgx"]
24+
std = ["digest/std", "mesalock_sgx"]
25+
mesalock_sgx = ["sgx_tstd"]
2426

2527
[badges]
2628
travis-ci = { repository = "RustCrypto/hashes" }

groestl/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535
//! [1]: https://en.wikipedia.org/wiki/Grøstl
3636
//! [2]: https://github.com/RustCrypto/hashes
3737
#![no_std]
38+
#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))]
3839
#![doc(html_logo_url =
3940
"https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")]
4041
#[macro_use] extern crate opaque_debug;
4142
#[macro_use] pub extern crate digest;
4243
extern crate block_buffer;
43-
#[cfg(feature = "std")]
44+
45+
#[cfg(all(feature = "std", feature = "mesalock_sgx", target_env = "sgx"))]
4446
extern crate std;
47+
#[cfg(all(feature = "std", feature = "mesalock_sgx", not(target_env = "sgx")))]
48+
extern crate sgx_tstd as std;
4549

4650
pub use digest::Digest;
4751
use digest::{Input, BlockInput, FixedOutput, VariableOutput, Reset};

md2/Cargo.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@ keywords = ["crypto", "md2", "hash", "digest"]
1010
categories = ["cryptography", "no-std"]
1111

1212
[dependencies]
13-
digest = "0.8"
14-
block-buffer = "0.7"
13+
digest = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
14+
block-buffer = { git = "https://github.com/mesalock-linux/rustcrypto-utils-sgx" }
1515
opaque-debug = "0.2"
16+
sgx_tstd = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
1617

1718
[dev-dependencies]
18-
digest = { version = "0.8", features = ["dev"] }
19-
hex-literal = "0.1"
19+
#digest = { version = "0.8", features = ["dev"] }
20+
#hex-literal = "0.1"
2021

2122
[features]
22-
default = ["std"]
23-
std = ["digest/std"]
23+
default = ["std", "mesalock_sgx"]
24+
std = ["digest/std", "mesalock_sgx"]
25+
mesalock_sgx = ["sgx_tstd"]
2426

2527
[badges]
2628
travis-ci = { repository = "RustCrypto/hashes" }

0 commit comments

Comments
 (0)