You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by rd...@apache.org on 2020/12/16 10:30:29 UTC

[incubator-teaclave-sgx-sdk] branch master updated: Fix mutability of the parameter `ctr` in rsgx_aes_ctr_{encrypt, decrypt}

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

rduan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-sgx-sdk.git


The following commit(s) were added to refs/heads/master by this push:
     new a06a12e  Fix mutability of the parameter `ctr` in rsgx_aes_ctr_{encrypt,decrypt}
     new 4d2c705  Merge pull request #301 from algon-320/fix_sgx_aes_ctr
a06a12e is described below

commit a06a12e39f778c49d02a870fca8708540cb7f2e4
Author: algon-320 <al...@gmail.com>
AuthorDate: Tue Dec 15 16:46:04 2020 +0900

    Fix mutability of the parameter `ctr` in rsgx_aes_ctr_{encrypt,decrypt}
---
 sgx_tcrypto/src/crypto.rs | 8 ++++----
 sgx_types/src/function.rs | 4 ++--
 sgx_ucrypto/src/crypto.rs | 8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/sgx_tcrypto/src/crypto.rs b/sgx_tcrypto/src/crypto.rs
index 2a9e84c..0f0e4db 100644
--- a/sgx_tcrypto/src/crypto.rs
+++ b/sgx_tcrypto/src/crypto.rs
@@ -1752,7 +1752,7 @@ pub type sgx_aes_ctr_128bit_ctr_t = [uint8_t; SGX_AESCTR_CTR_SIZE];
 pub fn rsgx_aes_ctr_encrypt(
     key: &sgx_aes_ctr_128bit_key_t,
     src: &[u8],
-    ctr: &sgx_aes_ctr_128bit_ctr_t,
+    ctr: &mut sgx_aes_ctr_128bit_ctr_t,
     ctr_inc_bits: u32,
     dst: &mut [u8],
 ) -> SgxError {
@@ -1776,7 +1776,7 @@ pub fn rsgx_aes_ctr_encrypt(
             key as *const sgx_aes_ctr_128bit_key_t,
             src.as_ptr(),
             src_len as u32,
-            ctr as *const sgx_aes_ctr_128bit_ctr_t as *const u8,
+            ctr as *mut sgx_aes_ctr_128bit_ctr_t as *mut u8,
             ctr_inc_bits,
             dst.as_mut_ptr(),
         )
@@ -1848,7 +1848,7 @@ pub fn rsgx_aes_ctr_encrypt(
 pub fn rsgx_aes_ctr_decrypt(
     key: &sgx_aes_ctr_128bit_key_t,
     src: &[u8],
-    ctr: &sgx_aes_ctr_128bit_ctr_t,
+    ctr: &mut sgx_aes_ctr_128bit_ctr_t,
     ctr_inc_bits: u32,
     dst: &mut [u8],
 ) -> SgxError {
@@ -1872,7 +1872,7 @@ pub fn rsgx_aes_ctr_decrypt(
             key as *const sgx_aes_ctr_128bit_key_t,
             src.as_ptr(),
             src.len() as u32,
-            ctr as *const sgx_aes_ctr_128bit_ctr_t as *const u8,
+            ctr as *mut sgx_aes_ctr_128bit_ctr_t as *mut u8,
             ctr_inc_bits,
             dst.as_mut_ptr(),
         )
diff --git a/sgx_types/src/function.rs b/sgx_types/src/function.rs
index 7132861..cefcede 100755
--- a/sgx_types/src/function.rs
+++ b/sgx_types/src/function.rs
@@ -255,14 +255,14 @@ extern "C" {
     pub fn sgx_aes_ctr_encrypt(p_key: *const sgx_aes_ctr_128bit_key_t,
                                p_src: *const uint8_t,
                                src_len: uint32_t,
-                               p_ctr: *const uint8_t,
+                               p_ctr: *mut uint8_t,
                                ctr_inc_bits: uint32_t,
                                p_dst: *mut uint8_t) -> sgx_status_t;
 
     pub fn sgx_aes_ctr_decrypt(p_key: *const sgx_aes_ctr_128bit_key_t,
                                p_src: *const uint8_t,
                                src_len: uint32_t,
-                               p_ctr: *const uint8_t,
+                               p_ctr: *mut uint8_t,
                                ctr_inc_bits: uint32_t,
                                p_dst: *mut uint8_t) -> sgx_status_t;
 
diff --git a/sgx_ucrypto/src/crypto.rs b/sgx_ucrypto/src/crypto.rs
index 5bc3d4d..7413dc4 100644
--- a/sgx_ucrypto/src/crypto.rs
+++ b/sgx_ucrypto/src/crypto.rs
@@ -1602,7 +1602,7 @@ pub type sgx_aes_ctr_128bit_ctr_t = [uint8_t; SGX_AESCTR_CTR_SIZE];
 pub fn rsgx_aes_ctr_encrypt(
     key: &sgx_aes_ctr_128bit_key_t,
     src: &[u8],
-    ctr: &sgx_aes_ctr_128bit_ctr_t,
+    ctr: &mut sgx_aes_ctr_128bit_ctr_t,
     ctr_inc_bits: u32,
     dst: &mut [u8],
 ) -> SgxError {
@@ -1626,7 +1626,7 @@ pub fn rsgx_aes_ctr_encrypt(
             key as *const sgx_aes_ctr_128bit_key_t,
             src.as_ptr(),
             src_len as u32,
-            ctr as *const sgx_aes_ctr_128bit_ctr_t as *const u8,
+            ctr as *mut sgx_aes_ctr_128bit_ctr_t as *mut u8,
             ctr_inc_bits,
             dst.as_mut_ptr(),
         )
@@ -1698,7 +1698,7 @@ pub fn rsgx_aes_ctr_encrypt(
 pub fn rsgx_aes_ctr_decrypt(
     key: &sgx_aes_ctr_128bit_key_t,
     src: &[u8],
-    ctr: &sgx_aes_ctr_128bit_ctr_t,
+    ctr: &mut sgx_aes_ctr_128bit_ctr_t,
     ctr_inc_bits: u32,
     dst: &mut [u8],
 ) -> SgxError {
@@ -1722,7 +1722,7 @@ pub fn rsgx_aes_ctr_decrypt(
             key as *const sgx_aes_ctr_128bit_key_t,
             src.as_ptr(),
             src.len() as u32,
-            ctr as *const sgx_aes_ctr_128bit_ctr_t as *const u8,
+            ctr as *mut sgx_aes_ctr_128bit_ctr_t as *mut u8,
             ctr_inc_bits,
             dst.as_mut_ptr(),
         )


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org