Skip to content

Commit

Permalink
Port to sgx 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dingelish committed Dec 18, 2019
1 parent 46afd2b commit 2f06fec
Show file tree
Hide file tree
Showing 100 changed files with 6,200 additions and 186 deletions.
237 changes: 237 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
kind: pipeline
name: stream-ciphers-sgx-xargo-1604-sw

steps:
- name: sim-compile
image: baiduxlab/sgx-rust:1604-1.1.0
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- cd sgx && SGX_MODE=SW XARGO_SGX=1 make -C stream-ciphers-sgx-test

- name: sim-test
image: baiduxlab/sgx-rust:1604-1.1.0
commands:
- . /opt/sgxsdk/environment
- cd sgx/stream-ciphers-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt

node:
instance: sgx

---

kind: pipeline
name: stream-ciphers-sgx-xargo-1604-hw

steps:
- name: hw-compile
image: baiduxlab/sgx-rust:1604-1.1.0
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- cd sgx && XARGO_SGX=1 make -C stream-ciphers-sgx-test

- name: hw-test
image: baiduxlab/sgx-rust:1604-1.1.0
privileged: true
volumes:
- name: isgx
path: /dev/isgx
- name: aesmd
path: /var/run/aesmd/aesm.socket
commands:
- . /opt/sgxsdk/environment
- ls -l /dev/isgx
- ls -l /var/run/aesmd/aesm.socket
- cd sgx/stream-ciphers-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt

volumes:
- name: isgx
host:
path: /dev/isgx
- name: aesmd
host:
path: /var/run/aesmd/aesm.socket

node:
instance: sgx

---

kind: pipeline
name: stream-ciphers-sgx-xargo-1804-sw

steps:
- name: sim-compile
image: baiduxlab/sgx-rust:1804-1.1.0
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- cd sgx && SGX_MODE=SW XARGO_SGX=1 make -C stream-ciphers-sgx-test

- name: sim-test
image: baiduxlab/sgx-rust:1804-1.1.0
commands:
- . /opt/sgxsdk/environment
- cd sgx/stream-ciphers-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt

node:
instance: sgx

---

kind: pipeline
name: stream-ciphers-sgx-xargo-1804-hw

steps:
- name: hw-compile
image: baiduxlab/sgx-rust:1804-1.1.0
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- cd sgx && XARGO_SGX=1 make -C stream-ciphers-sgx-test

- name: hw-test
image: baiduxlab/sgx-rust:1804-1.1.0
privileged: true
volumes:
- name: isgx
path: /dev/isgx
- name: aesmd
path: /var/run/aesmd/aesm.socket
commands:
- . /opt/sgxsdk/environment
- ls -l /dev/isgx
- ls -l /var/run/aesmd/aesm.socket
- cd sgx/stream-ciphers-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt

volumes:
- name: isgx
host:
path: /dev/isgx
- name: aesmd
host:
path: /var/run/aesmd/aesm.socket

node:
instance: sgx

---

kind: pipeline
name: stream-ciphers-sgx-1604-sw

steps:
- name: sim-compile
image: baiduxlab/sgx-rust:1604-1.1.0
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- SGX_MODE=SW make -C sgx/stream-ciphers-sgx-test

- name: sim-test
image: baiduxlab/sgx-rust:1604-1.1.0
commands:
- . /opt/sgxsdk/environment
- cd sgx/stream-ciphers-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt

node:
instance: sgx

---

kind: pipeline
name: stream-ciphers-sgx-1604-hw

steps:
- name: hw-compile
image: baiduxlab/sgx-rust:1604-1.1.0
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- make -C sgx/stream-ciphers-sgx-test

- name: hw-test
image: baiduxlab/sgx-rust:1604-1.1.0
privileged: true
volumes:
- name: isgx
path: /dev/isgx
- name: aesmd
path: /var/run/aesmd/aesm.socket
commands:
- . /opt/sgxsdk/environment
- ls -l /dev/isgx
- ls -l /var/run/aesmd/aesm.socket
- cd sgx/stream-ciphers-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt

volumes:
- name: isgx
host:
path: /dev/isgx
- name: aesmd
host:
path: /var/run/aesmd/aesm.socket

node:
instance: sgx

---

kind: pipeline
name: stream-ciphers-sgx-1804-sw

steps:
- name: sim-compile
image: baiduxlab/sgx-rust:1804-1.1.0
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- SGX_MODE=SW make -C sgx/stream-ciphers-sgx-test

- name: sim-test
image: baiduxlab/sgx-rust:1804-1.1.0
commands:
- . /opt/sgxsdk/environment
- cd sgx/stream-ciphers-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt

node:
instance: sgx

---

kind: pipeline
name: stream-ciphers-sgx-1804-hw

steps:
- name: hw-compile
image: baiduxlab/sgx-rust:1804-1.1.0
commands:
- . /opt/sgxsdk/environment
- . /root/.cargo/env
- make -C sgx/stream-ciphers-sgx-test

- name: hw-test
image: baiduxlab/sgx-rust:1804-1.1.0
privileged: true
volumes:
- name: isgx
path: /dev/isgx
- name: aesmd
path: /var/run/aesmd/aesm.socket
commands:
- . /opt/sgxsdk/environment
- ls -l /dev/isgx
- ls -l /var/run/aesmd/aesm.socket
- cd sgx/stream-ciphers-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt

volumes:
- name: isgx
host:
path: /dev/isgx
- name: aesmd
host:
path: /var/run/aesmd/aesm.socket

node:
instance: sgx
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
14 changes: 7 additions & 7 deletions aes-ctr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ keywords = ["crypto", "stream-cipher", "trait"]
categories = ["cryptography", "no-std"]

[dependencies]
stream-cipher = "0.3"
stream-cipher = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }

[target.'cfg(not(all(target_feature = "aes", target_feature = "sse2", target_feature = "ssse3", any(target_arch = "x86_64", target_arch = "x86"))))'.dependencies]
ctr = "0.3"
aes-soft = "0.3"
#[target.'cfg(not(all(target_feature = "aes", target_feature = "sse2", target_feature = "ssse3", any(target_arch = "x86_64", target_arch = "x86"))))'.dependencies]
#ctr = "0.3"
#aes-soft = "0.3"

[target.'cfg(all(target_feature = "aes", target_feature = "sse2", target_feature = "ssse3", any(target_arch = "x86_64", target_arch = "x86")))'.dependencies]
aesni = "0.6"
#[target.'cfg(all(target_feature = "aes", target_feature = "sse2", target_feature = "ssse3", any(target_arch = "x86_64", target_arch = "x86")))'.dependencies]
aesni = { git = "https://github.com/mesalock-linux/rustcrypto-block-ciphers-sgx" }

[dev-dependencies]
stream-cipher = { version = "0.3", features = ["dev"] }
#stream-cipher = { version = "0.3", features = ["dev"] }

[badges]
travis-ci = { repository = "RustCrypto/stream-ciphers" }
66 changes: 33 additions & 33 deletions aes-ctr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,44 @@
//! ```
#![no_std]
#![deny(missing_docs)]
#[cfg(not(all(
target_feature = "aes",
target_feature = "sse2",
target_feature = "ssse3",
any(target_arch = "x86_64", target_arch = "x86"),
)))]
extern crate aes_soft;
#[cfg(not(all(
target_feature = "aes",
target_feature = "sse2",
target_feature = "ssse3",
any(target_arch = "x86_64", target_arch = "x86"),
)))]
extern crate ctr;
//#[cfg(not(all(
// target_feature = "aes",
// target_feature = "sse2",
// target_feature = "ssse3",
// any(target_arch = "x86_64", target_arch = "x86"),
//)))]
//extern crate aes_soft;
//#[cfg(not(all(
// target_feature = "aes",
// target_feature = "sse2",
// target_feature = "ssse3",
// any(target_arch = "x86_64", target_arch = "x86"),
//)))]
//extern crate ctr;
pub extern crate stream_cipher;

#[cfg(not(all(
target_feature = "aes",
target_feature = "sse2",
target_feature = "ssse3",
any(target_arch = "x86_64", target_arch = "x86"),
)))]
mod dummy;
//#[cfg(not(all(
// target_feature = "aes",
// target_feature = "sse2",
// target_feature = "ssse3",
// any(target_arch = "x86_64", target_arch = "x86"),
//)))]
//mod dummy;

#[cfg(all(
target_feature = "aes",
target_feature = "sse2",
target_feature = "ssse3",
any(target_arch = "x86_64", target_arch = "x86"),
))]
//#[cfg(all(
// target_feature = "aes",
// target_feature = "sse2",
// target_feature = "ssse3",
// any(target_arch = "x86_64", target_arch = "x86"),
//))]
extern crate aesni;

#[cfg(all(
target_feature = "aes",
target_feature = "sse2",
target_feature = "ssse3",
any(target_arch = "x86_64", target_arch = "x86"),
))]
//#[cfg(all(
// target_feature = "aes",
// target_feature = "sse2",
// target_feature = "ssse3",
// any(target_arch = "x86_64", target_arch = "x86"),
//))]
use aesni as dummy;

pub use dummy::{Aes128Ctr, Aes192Ctr, Aes256Ctr};
8 changes: 4 additions & 4 deletions aes-ctr/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_std]
extern crate aes_ctr;
#[macro_use]
extern crate stream_cipher;
//#![no_std]
//extern crate aes_ctr;
//#[macro_use]
//extern crate stream_cipher;

use aes_ctr::{Aes128Ctr, Aes256Ctr};

Expand Down
10 changes: 5 additions & 5 deletions cfb-mode/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ keywords = ["crypto", "stream-cipher", "block-mode"]
categories = ["cryptography", "no-std"]

[dependencies]
stream-cipher = "0.3"
block-cipher-trait = "0.6"
stream-cipher = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }
block-cipher-trait = { git = "https://github.com/mesalock-linux/rustcrypto-traits-sgx" }

[dev-dependencies]
aes = "0.3"
stream-cipher = { version = "0.3", features = ["dev"] }
hex-literal = "0.1"
#aes = "0.3"
#stream-cipher = { version = "0.3", features = ["dev"] }
#hex-literal = "0.1"

[badges]
travis-ci = { repository = "RustCrypto/stream-ciphers" }
8 changes: 4 additions & 4 deletions cfb-mode/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate aes;
extern crate cfb_mode;
#[macro_use]
extern crate stream_cipher;
//extern crate aes;
//extern crate cfb_mode;
//#[macro_use]
//extern crate stream_cipher;

use cfb_mode::Cfb;

Expand Down
Loading

0 comments on commit 2f06fec

Please sign in to comment.