This is an automated email from the ASF dual-hosted git repository.

yuanz pushed a commit to branch release-v0.3.0
in repository 
https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git

commit fc0870a47b98d36e76a07ea9275a3f3603f61ead
Author: Yuan Zhuang <[email protected]>
AuthorDate: Thu Jun 27 08:41:12 2024 +0000

    code polishing
---
 examples/acipher-rs/ta/Xargo.toml                   |  1 -
 examples/aes-rs/ta/Xargo.toml                       |  1 -
 examples/authentication-rs/ta/Xargo.toml            |  1 -
 examples/big_int-rs/ta/Xargo.toml                   |  1 -
 examples/diffie_hellman-rs/ta/Xargo.toml            |  1 -
 examples/digest-rs/ta/Xargo.toml                    |  1 -
 examples/hello_world-rs/ta/Cargo.lock               | 11 +++--------
 examples/hello_world-rs/ta/Xargo.toml               |  1 -
 examples/hello_world-rs/ta/src/main.rs              |  1 -
 examples/hotp-rs/ta/Xargo.toml                      |  1 -
 examples/message_passing_interface-rs/ta/Xargo.toml |  1 -
 examples/random-rs/ta/Xargo.toml                    |  1 -
 examples/secure_storage-rs/ta/Xargo.toml            |  1 -
 examples/serde-rs/ta/Xargo.toml                     |  1 -
 examples/signature_verification-rs/ta/Xargo.toml    |  1 -
 examples/supp_plugin-rs/ta/Xargo.toml               |  1 -
 examples/tcp_client-rs/ta/Xargo.toml                |  1 -
 examples/time-rs/ta/Xargo.toml                      |  1 -
 examples/tls_client-rs/ta/Cargo.toml                |  6 ------
 examples/tls_client-rs/ta/Xargo.toml                |  1 -
 examples/tls_server-rs/ta/Xargo.toml                |  1 -
 examples/udp_socket-rs/ta/Xargo.toml                |  1 -
 optee-utee/Cargo.toml                               |  8 ++------
 optee-utee/src/crypto_op.rs                         |  2 --
 rust-toolchain.toml                                 |  4 ++--
 setup.sh                                            | 10 ++--------
 26 files changed, 9 insertions(+), 52 deletions(-)

diff --git a/examples/acipher-rs/ta/Xargo.toml 
b/examples/acipher-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/acipher-rs/ta/Xargo.toml
+++ b/examples/acipher-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/aes-rs/ta/Xargo.toml b/examples/aes-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/aes-rs/ta/Xargo.toml
+++ b/examples/aes-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/authentication-rs/ta/Xargo.toml 
b/examples/authentication-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/authentication-rs/ta/Xargo.toml
+++ b/examples/authentication-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/big_int-rs/ta/Xargo.toml 
b/examples/big_int-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/big_int-rs/ta/Xargo.toml
+++ b/examples/big_int-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/diffie_hellman-rs/ta/Xargo.toml 
b/examples/diffie_hellman-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/diffie_hellman-rs/ta/Xargo.toml
+++ b/examples/diffie_hellman-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/digest-rs/ta/Xargo.toml b/examples/digest-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/digest-rs/ta/Xargo.toml
+++ b/examples/digest-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/hello_world-rs/ta/Cargo.lock 
b/examples/hello_world-rs/ta/Cargo.lock
index 96058f4..21f846b 100644
--- a/examples/hello_world-rs/ta/Cargo.lock
+++ b/examples/hello_world-rs/ta/Cargo.lock
@@ -18,18 +18,13 @@ checksum = 
"7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
 name = "libc"
 version = "0.2.153"
 
-[[package]]
-name = "libc"
-version = "0.2.153"
-source = 
"git+https://github.com/DemesneGH/libc.git?branch=optee#4fa30318ed3175f6ebe22da8f167f9f9b34567c3";
-
 [[package]]
 name = "optee-utee"
 version = "0.2.0"
 dependencies = [
  "bitflags",
  "hex",
- "libc 0.2.153 (git+https://github.com/DemesneGH/libc.git?branch=optee)",
+ "libc",
  "optee-utee-macros",
  "optee-utee-sys",
  "uuid",
@@ -47,7 +42,7 @@ dependencies = [
 name = "optee-utee-sys"
 version = "0.2.0"
 dependencies = [
- "libc 0.2.153",
+ "libc",
 ]
 
 [[package]]
@@ -90,7 +85,7 @@ dependencies = [
 name = "ta"
 version = "0.2.0"
 dependencies = [
- "libc 0.2.153",
+ "libc",
  "optee-utee",
  "optee-utee-sys",
  "proto",
diff --git a/examples/hello_world-rs/ta/Xargo.toml 
b/examples/hello_world-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/hello_world-rs/ta/Xargo.toml
+++ b/examples/hello_world-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/hello_world-rs/ta/src/main.rs 
b/examples/hello_world-rs/ta/src/main.rs
index c184713..f7b2a00 100644
--- a/examples/hello_world-rs/ta/src/main.rs
+++ b/examples/hello_world-rs/ta/src/main.rs
@@ -22,7 +22,6 @@ use optee_utee::{
 };
 use optee_utee::{Error, ErrorKind, Parameters, Result};
 use proto::Command;
-use std::collections::HashMap;
 
 #[ta_create]
 fn create() -> Result<()> {
diff --git a/examples/hotp-rs/ta/Xargo.toml b/examples/hotp-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/hotp-rs/ta/Xargo.toml
+++ b/examples/hotp-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/message_passing_interface-rs/ta/Xargo.toml 
b/examples/message_passing_interface-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/message_passing_interface-rs/ta/Xargo.toml
+++ b/examples/message_passing_interface-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/random-rs/ta/Xargo.toml b/examples/random-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/random-rs/ta/Xargo.toml
+++ b/examples/random-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/secure_storage-rs/ta/Xargo.toml 
b/examples/secure_storage-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/secure_storage-rs/ta/Xargo.toml
+++ b/examples/secure_storage-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/serde-rs/ta/Xargo.toml b/examples/serde-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/serde-rs/ta/Xargo.toml
+++ b/examples/serde-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/signature_verification-rs/ta/Xargo.toml 
b/examples/signature_verification-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/signature_verification-rs/ta/Xargo.toml
+++ b/examples/signature_verification-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/supp_plugin-rs/ta/Xargo.toml 
b/examples/supp_plugin-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/supp_plugin-rs/ta/Xargo.toml
+++ b/examples/supp_plugin-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/tcp_client-rs/ta/Xargo.toml 
b/examples/tcp_client-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/tcp_client-rs/ta/Xargo.toml
+++ b/examples/tcp_client-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/time-rs/ta/Xargo.toml b/examples/time-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/time-rs/ta/Xargo.toml
+++ b/examples/time-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/tls_client-rs/ta/Cargo.toml 
b/examples/tls_client-rs/ta/Cargo.toml
index 067dbe8..a604bb1 100644
--- a/examples/tls_client-rs/ta/Cargo.toml
+++ b/examples/tls_client-rs/ta/Cargo.toml
@@ -30,15 +30,9 @@ proto = { path = "../proto" }
 optee-utee-sys = { path = "../../../optee-utee/optee-utee-sys" }
 optee-utee = { path = "../../../optee-utee" }
 
-#rustls = { git = "https://github.com/DemesneGH/rustls.git";, branch = 
"veracruz" }
-
 # use new ported version
 rustls = { git = "https://github.com/DemesneGH/rustls-optee.git";, branch = 
"0.21.0-optee", features = ["dangerous_configuration"]}
 ring = "=0.16.20"
-
-#webpki = { git = "https://github.com/veracruz-project/webpki.git";, branch = 
"veracruz", features = ["default"] }
-#webpki-roots = { git = 
"https://github.com/veracruz-project/webpki-roots.git";, branch = "veracruz", 
features = ["default"] }
-
 webpki-roots = "0.21"
 webpki = "=0.21.0"
 sct = "=0.7.0"
diff --git a/examples/tls_client-rs/ta/Xargo.toml 
b/examples/tls_client-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/tls_client-rs/ta/Xargo.toml
+++ b/examples/tls_client-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/tls_server-rs/ta/Xargo.toml 
b/examples/tls_server-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/tls_server-rs/ta/Xargo.toml
+++ b/examples/tls_server-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/examples/udp_socket-rs/ta/Xargo.toml 
b/examples/udp_socket-rs/ta/Xargo.toml
index 7c09142..1b1a113 100644
--- a/examples/udp_socket-rs/ta/Xargo.toml
+++ b/examples/udp_socket-rs/ta/Xargo.toml
@@ -20,6 +20,5 @@ path = "../../../rust/rust/library/std"
 
 [patch.crates-io]
 libc =  { path = "../../../rust/libc" }
-#compiler_builtins =  { path = "../../../rust/compiler-builtins" }
 rustc-std-workspace-core = { path = 
"../../../rust/rust/library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = 
"../../../rust/rust/library/rustc-std-workspace-alloc" }
diff --git a/optee-utee/Cargo.toml b/optee-utee/Cargo.toml
index 8ad19e0..a0772fe 100644
--- a/optee-utee/Cargo.toml
+++ b/optee-utee/Cargo.toml
@@ -27,14 +27,10 @@ edition = "2018"
 [dependencies]
 optee-utee-sys = { path = "optee-utee-sys" }
 optee-utee-macros = { path = "macros" }
-libc =  { git = "https://github.com/DemesneGH/libc.git";, branch = "optee" }
-#libc = { path = "../rust/libc", version = "=0.2.153" }
+libc = { path = "../rust/libc", version = "=0.2.153" }
 bitflags = "1.0"
 uuid = { version = "1.8", default-features = false }
 hex = { version = "0.4", default-features = false, features = ["alloc"] }
 
 #[workspace]
-#members = ['systest']
-
-[patch.crates-io]
-#libc =  { git = "https://github.com/DemesneGH/libc.git";, branch = "optee" }
+#members = ['systest']
\ No newline at end of file
diff --git a/optee-utee/src/crypto_op.rs b/optee-utee/src/crypto_op.rs
index 1d6664e..21d422d 100644
--- a/optee-utee/src/crypto_op.rs
+++ b/optee-utee/src/crypto_op.rs
@@ -17,7 +17,6 @@
 
 use crate::{Attribute, Error, ObjHandle, Result, TransientObject};
 use optee_utee_sys as raw;
-use crate::trace_println;
 use std::{mem, ptr};
 
 /// Specify one of the available cryptographic operations.
@@ -763,7 +762,6 @@ impl Mac {
     /// 4) Hardware or cryptographic algorithm failure.
     /// 5) If the Implementation detects any other error.
     pub fn init(&self, iv: &[u8]) {
-        trace_println!("iv ptr: {:?}", iv.as_ptr());
         unsafe { raw::TEE_MACInit(self.handle(), iv.as_ptr() as _, iv.len()) };
     }
 
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index ba1af6d..fd75996 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -19,6 +19,6 @@
 
 [toolchain]
 channel = "nightly-2024-05-15"
-components = ["rust-src", "rust-std", "rustc"]
 targets = ["aarch64-unknown-linux-gnu", "arm-unknown-linux-gnueabihf"]
-#targets = ["aarch64-unknown-optee"]
+# minimal profile: install rustc, cargo, and rust-std
+profile = "minimal"
\ No newline at end of file
diff --git a/setup.sh b/setup.sh
index 11da2e8..6bc9f8e 100755
--- a/setup.sh
+++ b/setup.sh
@@ -26,7 +26,7 @@ cd "$(dirname "$0")"
 ##########################################
 # install rustup and stable Rust if needed
 if command -v rustup &>/dev/null ; then
-       rustup install stable
+       rustup uninstall stable && rustup install stable
 else
        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
        source "$HOME/.cargo/env"
@@ -93,9 +93,8 @@ fi
 
 
 ########################################################
-# initialize submodules: rust / compiler-builtins / libc
+# initialize submodules: rust / libc
 RUST_COMMIT_ID=7ee181c5199b0769414f0d0fd13f5e959ef84c27
-#COMPILER_BUILTINS_COMMIT_ID=42284ae2bc0937440ab1c1edd08981107b6a976c
 LIBC_COMMIT_ID=4fa30318ed3175f6ebe22da8f167f9f9b34567c3
 
 if [ -d rust/ ]
@@ -111,11 +110,6 @@ git clone https://github.com/DemesneGH/rust.git && \
        git submodule update --init library/stdarch && \
        git submodule update --init library/backtrace)
 
-# git clone https://github.com/DemesneGH/compiler-builtins.git && \
-#      (cd compiler-builtins && \
-#      git checkout "$COMPILER_BUILTINS_COMMIT_ID" && \
-#      git submodule update --init libm)
-
 git clone https://github.com/DemesneGH/libc.git && \
        (cd libc && \
        git checkout "$LIBC_COMMIT_ID")


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to