md5: Added mbedtls implementation #4980
Closed
Conversation
lib/md5.c
Outdated
(void) mbedtls_md5_update_ret(ctx, data, length); | ||
} | ||
|
||
static void MD5_Final(unsigned char digest[16], MD5_CTX *ctx) |
jay
Feb 25, 2020
Member
I get why you did this (because mbedtls does I assume) but I think the fixed size array style is misleading, if you sizeof(digest) it's going to be the size of the pointer not of the array. If we are passing *input I think it should just be passed as that.
I get why you did this (because mbedtls does I assume) but I think the fixed size array style is misleading, if you sizeof(digest) it's going to be the size of the pointer not of the array. If we are passing *input I think it should just be passed as that.
jay
Feb 25, 2020
Member
NEvermind it looks like that's the current convention, I'd stick with it.
NEvermind it looks like that's the current convention, I'd stick with it.
captain-caveman2k
Feb 25, 2020
•
Author
Member
Unfortunately it's not related to mbedtls, the other (well... GnuTLS based) functions use this style and you'll also note that the SHA256 code does this too (I'm guessing as the MD5 code was used as a template).
I'm personally not a fan if it because of it for the reason you gave ;-) As such you'll note I've used pointer notation in PR #4956 for my new SHA256 functions and corrected the existing function to match.
Unfortunately it's not related to mbedtls, the other (well... GnuTLS based) functions use this style and you'll also note that the SHA256 code does this too (I'm guessing as the MD5 code was used as a template).
I'm personally not a fan if it because of it for the reason you gave ;-) As such you'll note I've used pointer notation in PR #4956 for my new SHA256 functions and corrected the existing function to match.
90572db
to
48e62c7
48e62c7
to
7ab6571
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.
No description provided.