Update annotations of sgx_sealed_data_t and sgx_aes_gcm_data_t (#639)#640
Open
yang8621 wants to merge 1 commit intointel:mainfrom
Open
Update annotations of sgx_sealed_data_t and sgx_aes_gcm_data_t (#639)#640yang8621 wants to merge 1 commit intointel:mainfrom
yang8621 wants to merge 1 commit intointel:mainfrom
Conversation
…#639) Signed-off-by: Huang Yang <yang.huang@intel.com>
lzha101
reviewed
Dec 8, 2020
| uint32_t payload_size; /* 0: Size of the payload which includes both the encrypted data and the optional additional MAC text */ | ||
| uint8_t reserved[12]; /* 4: Reserved bits */ | ||
| uint32_t payload_size; /* 0: Size of the payload which includes the encrypted data: payload[] */ | ||
| uint8_t reserved[SGX_SEAL_IV_SIZE]; /* 4: Reserved bits used as iv */ |
Contributor
There was a problem hiding this comment.
Although the value of the used IV in tseal library is the same as this reserved bits array, but they are indeed different buffers. This reserved array is actually to make the structure 16byte aligned.
Author
There was a problem hiding this comment.
Contributor
There was a problem hiding this comment.
OK. Thanks for the explanation. This usage may not be aligned with the initial design of the structure. But the functionality is correct.
lzha101
reviewed
Dec 8, 2020
| { | ||
| uint32_t payload_size; /* 0: Size of the payload which includes both the encrypted data and the optional additional MAC text */ | ||
| uint8_t reserved[12]; /* 4: Reserved bits */ | ||
| uint32_t payload_size; /* 0: Size of the payload which includes the encrypted data: payload[] */ |
Contributor
There was a problem hiding this comment.
The payload[] includes encrypted data and the optional additional authenticated data if users seal data with a plaintext (for example, sgx_seal_data() is called with p_additional_MACtext not NULL). So I suppose the previous annotation is correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Huang Yang yang.huang@intel.com