-
Notifications
You must be signed in to change notification settings - Fork 56
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
Last byte of plaintext should not be ignored. #16
base: master
Are you sure you want to change the base?
Last byte of plaintext should not be ignored. #16
Conversation
…erminated string. Especially that length is given explicitly. Code should not assume final character is terminator in that case. Due to that substraction of 1 breaks the message (one byte of plaintext is ignored).
will review! |
the -1 have to be replaced in more than one function. |
I checked the other functions in AES.cpp and don't think that there is any other function where the "-1" would need to be replaced. In my few this pull request can be accepted as is. |
Combined proposed fixes of pull requests spaniakos#15 and spaniakos#16 plus the required change of the function `AES::CheckPad(byte* in,int lsize)`. The function `AES::calc_size_n_pad`could be simplified by combining spaniakos#15 and spaniakos#16 and also ` `AES::CheckPad` is simpler because there is always padding added. The definition of `byte arr_pad` in `AES.h` must also be aligned for the extra padding value 0x10.
i will test the code. now for the padding, i saw that you you have made the padding array 0x01 to 0x10 nevertheless, i will test your code against the tests and afterwards will accept the pull request. |
Hi @spaniakos |
will sure do! |
Messages passed are byte arrays. There is no hint the array is NULL terminated string. Especially that length is given explicitly. Code should not assume final character is terminator in that case. Due to that substraction of 1 breaks the message (one byte of plaintext is ignored).