-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ltc: ctr: update pt and ct after acceleration #2086
Conversation
Is the |
TL;DR: please just replace I suggest using a Note, the Linux kernel has the same convention when it comes to sending patches to the mailing lists, except that the [Update: it looks like the presence of the From: line is enough for GitHub to attribute the commit to the original author, which is quite convenient]. |
Problem occurs in the condition of the following case: 1st decryption: Decrypt a ciphertext whose length is a multiple of the block size (16B) (len = n * block_size) 2nd decryption: Decrypt the continuing ciphertext whose length is not a multiple of the block size (len = m * block_size + l) In this case accel_ctr_encrypt() is firstly used at the 2nd decryption. If pt and ct are not updated, the top (l = len % block_size) bytes of decryption result are sometimes destroyed. From: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com> Signed-off-by: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com> Signed-off-by: Victor Chong <victor.chong@linaro.org>
@sjaeckel FYI. |
@jforissier Updated. Thanks! |
Adds a AES-CTR corner case to expose a problem in LTC with hardware accelerated AES encryption. The fix for the problem is provided in: OP-TEE/optee_os#2086 Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Here's a test case OP-TEE/optee_test#248 |
thx! c.f. libtom/libtomcrypt@d1d3ae2 |
@jenswi-linaro you beat me to it ;-) |
|
Adds a AES-CTR corner case to expose a problem in LTC with hardware accelerated AES encryption. The fix for the problem is provided in: OP-TEE/optee_os#2086 Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Merged manually. Thanks guys. @jenswi-linaro I have converted your "LGTM" (that you gave via email) into an Acked-by: |
Adds a AES-CTR corner case to expose a problem in LTC with hardware accelerated AES encryption. The fix for the problem is provided in: OP-TEE/optee_os#2086 Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Problem occurs in the condition of the following case:
1st decryption:
Decrypt a ciphertext whose length is a multiple of the block size (16B)
(len = n * block_size)
2nd decryption:
Decrypt the continuing ciphertext whose length is not a multiple of the
block size
(len = m * block_size + l)
In this case accel_ctr_encrypt() is firstly used at the 2nd decryption.
If pt and ct are not updated, the top (l = len % block_size) bytes of
decryption result are sometimes destroyed.
Reported-by: Tetsuya Yoshizaki yoshizaki.tetsuya@socionext.com
Signed-off-by: Tetsuya Yoshizaki yoshizaki.tetsuya@socionext.com
Signed-off-by: Victor Chong victor.chong@linaro.org