I met the same problem.
```
[+] global_eid: 2
[+] sha256 input string is abc
[+] Expected SHA256 hash: 
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
calc_sha256 invoked!
Input string len = 3, input len = 3
[+] SHA256 result is 
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
[+] calc_sha256 success ...
[+] Starting aes-gcm-128 encrypt calculation
Segmentation fault (core dumped)
```
Maybe it's because all the following functions:
`sha256(`),  `aes_gcm_128()`, `aes_cmac()`, `rsa()` in app.c don't have a 
return value in the end of main logic(C doesn't need a return value in the end 
necessarily so compiler doesn't report an error)
when I put **_return 0_** to  all the functions mentioned, the result comes.
for example aes_gcm_128()
```
...
printf("[+] aes-gcm-128 decrypt complete \n");
return 0;
```
And the result will be right like
```
[+] global_eid: 2
[+] sha256 input string is abc
[+] Expected SHA256 hash: 
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
calc_sha256 invoked!
Input string len = 3, input len = 3
[+] SHA256 result is 
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
[+] calc_sha256 success ...
[+] Starting aes-gcm-128 encrypt calculation
[+] aes-gcm-128 args prepared!
[+] aes-gcm-128 expected ciphertext: 0388dace60b6a392f328c2b971b2fe78
aes_gcm_128_encrypt invoked!
aes_gcm_128_encrypt parameter prepared! 16, 16
rsgx calling returned!
[+] aes-gcm-128 returned from enclave!
[+] aes-gcm-128 ciphertext is: 8b2f0fd33bc9a392539c17a42acdfe78
[+] aes-gcm-128 result mac is: 1f6b73897cfc62f3266b8f39de52b8a0
[+] Starting aes-gcm-128 decrypt calculation
[+] aes-gcm-128 expected plaintext:88a7d51d5b7f0000a0b4d51d5b7f0000
aes_gcm_128_decrypt invoked!
aes_gcm_128_decrypt parameter prepared! 16, 16
rsgx calling returned!
[+] aes-gcm-128 decrypted plaintext is: 88a7d51d5b7f0000a0b4d51d5b7f0000
[+] aes-gcm-128 decrypt complete 
[+] Starting aes-cmac test 
[+] aes-cmac expected digest: 51f0bebf7e3b9d92fc49741779363cfe
[+] aes-cmac result is: 51f0bebf7e3b9d92fc49741779363cfe
rsa chipertext_len: 256
rsa plaintext_len: 128
rsa_key success. 
```

I think there may be something wrong with the compiler?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/285#issuecomment-726482361

Reply via email to