Skip to content

Instantly share code, notes, and snippets.

@glassonion1
Created August 25, 2021 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glassonion1/7fa747d956854440d202b91fe3b0da4b to your computer and use it in GitHub Desktop.
Save glassonion1/7fa747d956854440d202b91fe3b0da4b to your computer and use it in GitHub Desktop.
participant "main.rs : App" as App
participant "lib.rs:Enclave" as Enclave
participant "secret_key:OnceCell" as OnceCell
App -> Enclave: ecall_get_encryption_key<<ECall>>
Enclave -> Enclave: "generates key pair"
Enclave -> OnceCell: set
return
Enclave --> App: public_key
App -> App: "generates key pair"
App -> App: "generates a nonce"
App -> App: "encrypts the message"
App -> Enclave: ecall_decrypt<<ECall>>
Enclave -> OnceCell: get
return
Enclave -> Enclave: "decrypts message"
Enclave --> App: SGX_SUCCESS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment