Skip to content

Commit

Permalink
Add SGX
Browse files Browse the repository at this point in the history
  • Loading branch information
dingelish committed Oct 9, 2019
1 parent 7f3080b commit aec1a24
Show file tree
Hide file tree
Showing 31 changed files with 396 additions and 101 deletions.
101 changes: 101 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
kind: pipeline
name: hashes-sgx-xargo-1604-release

steps:
- name: release-compile
image: baiduxlab/sgx-rust:1604-1.0.9
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx --release

---

kind: pipeline
name: hashes-sgx-xargo-1604-debug

steps:
- name: debug-compile
image: baiduxlab/sgx-rust:1604-1.0.9
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx

---

kind: pipeline
name: hashes-sgx-xargo-1804-release

steps:
- name: release-compile
image: baiduxlab/sgx-rust:1804-1.0.9
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx --release

---

kind: pipeline
name: hashes-sgx-xargo-1804-debug

steps:
- name: debug-compile
image: baiduxlab/sgx-rust:1804-1.0.9
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx

---

kind: pipeline
name: hashes-sgx-1604-release

steps:
- name: release-compile
image: baiduxlab/sgx-rust:1604-1.0.9
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- cargo build --release

---

kind: pipeline
name: hashes-sgx-1604-hw-debug

steps:
- name: debug-compile
image: baiduxlab/sgx-rust:1604-1.0.9
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- cargo build

---

kind: pipeline
name: hashes-sgx-1804-release

steps:
- name: release-compile
image: baiduxlab/sgx-rust:1804-1.0.9
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- cargo build --release

---

kind: pipeline
name: hashes-sgx-1804-debug

steps:
- name: debug-compile
image: baiduxlab/sgx-rust:1804-1.0.9
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- cargo build
5 changes: 5 additions & 0 deletions .github/pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: "1"
rules:
- base: master
upstream: RustCrypto:master
mergeMethod: none
90 changes: 90 additions & 0 deletions Xargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[dependencies]
alloc = {}

[dependencies.sgx_types]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 1

[dependencies.sgx_demangle]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 1

[dependencies.panic_abort]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 1

[dependencies.sgx_libc]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 2

[dependencies.sgx_tkey_exchange]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 2

[dependencies.sgx_tservice]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 2

[dependencies.sgx_tse]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 2

[dependencies.sgx_tcrypto]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 2

[dependencies.sgx_trts]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 3

[dependencies.sgx_backtrace_sys]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 3

[dependencies.sgx_unwind]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 4

[dependencies.sgx_tdh]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 4

[dependencies.sgx_tseal]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 4

[dependencies.sgx_tprotected_fs]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 4

[dependencies.sgx_alloc]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 4

[dependencies.panic_unwind]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 5

[dependencies.std]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 6

[dependencies.sgx_rand]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 7

[dependencies.sgx_serialize]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 7

[dependencies.sgx_tunittest]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 7

[dependencies.sgx_backtrace]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 8

[dependencies.sgx_cov]
git = "https://github.com/baidu/rust-sgx-sdk.git"
stage = 8
18 changes: 10 additions & 8 deletions blake2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,24 @@ keywords = ["crypto", "blake2", "hash", "digest"]
categories = ["cryptography", "no-std"]

[dependencies]
digest = "0.8"
byte-tools = "0.3"
crypto-mac = "0.7"
digest = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
byte-tools = { git = "https://github.com/mesalock-linux/rustcrypto-utils-sgx" }
crypto-mac = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
opaque-debug = "0.2"
sgx_tstd = { rev = "v1.0.9", git = "https://github.com/baidu/rust-sgx-sdk.git", optional = true }

[dev-dependencies]
digest = { version = "0.8", features = ["dev"] }
crypto-mac = { version = "0.7", features = ["dev"] }
hex-literal = "0.1"
#digest = { version = "0.8", features = ["dev"] }
#crypto-mac = { version = "0.7", features = ["dev"] }
#hex-literal = "0.1"

[features]
default = ["std"]
std = ["digest/std", "crypto-mac/std"]
default = ["std", "mesalock_sgx"]
std = ["digest/std", "crypto-mac/std", "mesalock_sgx"]
simd = []
simd_opt = ["simd"]
simd_asm = ["simd_opt"]
mesalock_sgx = ["sgx_tstd"]

[badges]
travis-ci = { repository = "RustCrypto/hashes" }
5 changes: 4 additions & 1 deletion blake2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,17 @@

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

#[macro_use] extern crate opaque_debug;
#[macro_use] pub extern crate digest;
extern crate byte_tools;
pub extern crate crypto_mac;

#[cfg(feature = "std")]
#[cfg(all(feature = "std", feature = "mesalock_sgx", target_env = "sgx"))]
extern crate std;
#[cfg(all(feature = "std", feature = "mesalock_sgx", not(target_env = "sgx")))]
extern crate sgx_tstd as std;

mod consts;
mod as_bytes;
Expand Down
12 changes: 7 additions & 5 deletions gost94/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ keywords = ["crypto", "gost94", "gost", "hash", "digest"]
categories = ["cryptography", "no-std"]

[dependencies]
digest = "0.8"
block-buffer = "0.7"
digest = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
block-buffer = { git = "https://github.com/mesalock-linux/rustcrypto-utils-sgx" }
opaque-debug = "0.2"
sgx_tstd = { rev = "v1.0.9", git = "https://github.com/baidu/rust-sgx-sdk.git", optional = true }

[dev-dependencies]
digest = { version = "0.8", features = ["dev"] }
hex-literal = "0.1"
#digest = { version = "0.8", features = ["dev"] }
#hex-literal = "0.1"

[features]
default = ["std"]
std = ["digest/std"]
std = ["digest/std", "mesalock_sgx"]
mesalock_sgx = ["sgx_tstd"]

[badges]
travis-ci = { repository = "RustCrypto/hashes" }
6 changes: 5 additions & 1 deletion gost94/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@
//! [1]: https://en.wikipedia.org/wiki/GOST_(hash_function)
//! [2]: https://github.com/RustCrypto/hashes
#![no_std]
#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))]
#![doc(html_logo_url =
"https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")]
extern crate block_buffer;
#[macro_use] pub extern crate digest;
#[macro_use] extern crate opaque_debug;
#[cfg(feature = "std")]

#[cfg(all(feature = "std", feature = "mesalock_sgx", target_env = "sgx"))]
extern crate std;
#[cfg(all(feature = "std", feature = "mesalock_sgx", not(target_env = "sgx")))]
extern crate sgx_tstd as std;

#[macro_use]
mod macros;
Expand Down
14 changes: 8 additions & 6 deletions groestl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ keywords = ["crypto", "groestl", "grostl", "hash", "digest"]
categories = ["cryptography", "no-std"]

[dependencies]
digest = "0.8"
block-buffer = "0.7"
digest = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
block-buffer = { git = "https://github.com/mesalock-linux/rustcrypto-utils-sgx" }
opaque-debug = "0.2"
sgx_tstd = { rev = "v1.0.9", git = "https://github.com/baidu/rust-sgx-sdk.git", optional = true }

[dev-dependencies]
digest = { version = "0.8", features = ["dev"] }
hex-literal = "0.1"
#digest = { version = "0.8", features = ["dev"] }
#hex-literal = "0.1"

[features]
default = ["std"]
std = ["digest/std"]
default = ["std", "mesalock_sgx"]
std = ["digest/std", "mesalock_sgx"]
mesalock_sgx = ["sgx_tstd"]

[badges]
travis-ci = { repository = "RustCrypto/hashes" }
6 changes: 5 additions & 1 deletion groestl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@
//! [1]: https://en.wikipedia.org/wiki/Grøstl
//! [2]: https://github.com/RustCrypto/hashes
#![no_std]
#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))]
#![doc(html_logo_url =
"https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")]
#[macro_use] extern crate opaque_debug;
#[macro_use] pub extern crate digest;
extern crate block_buffer;
#[cfg(feature = "std")]

#[cfg(all(feature = "std", feature = "mesalock_sgx", target_env = "sgx"))]
extern crate std;
#[cfg(all(feature = "std", feature = "mesalock_sgx", not(target_env = "sgx")))]
extern crate sgx_tstd as std;

pub use digest::Digest;
use digest::{Input, BlockInput, FixedOutput, VariableOutput, Reset};
Expand Down
14 changes: 8 additions & 6 deletions md2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ keywords = ["crypto", "md2", "hash", "digest"]
categories = ["cryptography", "no-std"]

[dependencies]
digest = "0.8"
block-buffer = "0.7"
digest = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
block-buffer = { git = "https://github.com/mesalock-linux/rustcrypto-utils-sgx" }
opaque-debug = "0.2"
sgx_tstd = { rev = "v1.0.9", git = "https://github.com/baidu/rust-sgx-sdk.git", optional = true }

[dev-dependencies]
digest = { version = "0.8", features = ["dev"] }
hex-literal = "0.1"
#digest = { version = "0.8", features = ["dev"] }
#hex-literal = "0.1"

[features]
default = ["std"]
std = ["digest/std"]
default = ["std", "mesalock_sgx"]
std = ["digest/std", "mesalock_sgx"]
mesalock_sgx = ["sgx_tstd"]

[badges]
travis-ci = { repository = "RustCrypto/hashes" }
5 changes: 4 additions & 1 deletion md2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@
//! [1]: https://en.wikipedia.org/wiki/MD4
//! [2]: https://github.com/RustCrypto/hashes
#![no_std]
#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))]
#![doc(html_logo_url =
"https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")]
#![cfg_attr(feature = "cargo-clippy", allow(needless_range_loop))]
#[macro_use] extern crate opaque_debug;
#[macro_use] pub extern crate digest;
extern crate block_buffer;
#[cfg(feature = "std")]
#[cfg(all(feature = "std", feature = "mesalock_sgx", target_env = "sgx"))]
extern crate std;
#[cfg(all(feature = "std", feature = "mesalock_sgx", not(target_env = "sgx")))]
extern crate sgx_tstd as std;

pub use digest::Digest;
use digest::{Input, BlockInput, FixedOutput, Reset};
Expand Down
Loading

0 comments on commit aec1a24

Please sign in to comment.