-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crypto API: Separate IV from ciphertext based on struct cipher_ctx::flags #20561
Labels
Comments
Related to: #20434 |
sidcha
changed the title
Crypto API: Separate IV from ciphertext when based on struct cipher_ctx::flags
Crypto API: Separate IV from ciphertext based on struct cipher_ctx::flags
Nov 10, 2019
Does anyone have any objections/suggestions on this approach? Do I go ahead to a PR? |
Go with an RFC PR. |
@tbursztyka: I've raised PR. Could you please help add the RFC label to it? I cannot add it. |
tbursztyka
changed the title
Crypto API: Separate IV from ciphertext based on struct cipher_ctx::flags
[RFC]Crypto API: Separate IV from ciphertext based on struct cipher_ctx::flags
Nov 28, 2019
it was just needed in the title of the PR (hum, note to mysefl: the pr, not the issue...) |
tbursztyka
changed the title
[RFC]Crypto API: Separate IV from ciphertext based on struct cipher_ctx::flags
Crypto API: Separate IV from ciphertext based on struct cipher_ctx::flags
Nov 28, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem:
The crypto API now prefixes the IV to to the ciphertext. This is because Tinycrypt expects the IV and ciphertext to be in the contiguous memory for better performance. This is a problem if applications what to do inplace encrypt/decrypt (
in_buf == out_buf
) as now, thein_buf
has to be larger by 2x block length and the IV has to be removed manually. Besides, not all use-cases expect IV to be prefixed to the ciphertext.Proposed Solution:
Create new flag and pass it in struct
cipher_ctx::flags
that would allowout_buf
to have only ciphertext. This means the TC shim would now have to do some extra buffer copy but MbedTLS can skip some.I will raise a PR based on comments here.
The text was updated successfully, but these errors were encountered: