-
Notifications
You must be signed in to change notification settings - Fork 163
Add support for SHA-512 message digest #42
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Fabio Utzig <[email protected]>
#define sigma1(a)(ROTR((a), 19) ^ ROTR((a), 61) ^ ((a) >> 6)) | ||
|
||
#define Ch(a, b, c)(((a) & (b)) ^ ((~(a)) & (c))) | ||
#define Maj(a, b, c)(((a) & (b)) ^ ((a) & (c)) ^ ((b) & (c))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two macros are exactly the same in sha256.c
maybe would be better move it utils.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it makes more sense to leave them here, because it's just two simple definitions that don't increase code size; it ends up being just a maintenance issue, but since the SHA family of hash primitives is not going to change, these definitions are most probably gonna stay here untouched forever! Also utils.h
feels a bit too generic, maybe then it would be better to add a sha.h
(or sha_data.h
, sha_priv.h
, etc) file under lib/source
to store the shared code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patch looks good to me. @mczraf can you take a look too ?
A patch adding sha-512 to upstream tinycrypt was submitted: intel/tinycrypt#42 While it is not accepted, add the code under a new ext/tinycrypt-sha512 depedency. Signed-off-by: Fabio Utzig <[email protected]>
A patch adding sha-512 to upstream tinycrypt was submitted: intel/tinycrypt#42 While it is not accepted, add the code under a new ext/tinycrypt-sha512 depedency. Signed-off-by: Fabio Utzig <[email protected]>
Hi Fabio,
Please allow me some time to see how this code can be reviewed from a
cryptographic perspective.
I will get back to you late next week. Thank you for your understanding.
Rafael
…On Fri, Mar 13, 2020 at 8:43 AM Fabio Utzig ***@***.***> wrote:
@mczraf <https://github.com/mczraf> @ceolin <https://github.com/ceolin>
So is someone still reviewing this or am I missing something?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACDY5OUOFDXSMIOYJGLMR63RHIS6RANCNFSM4KCIJPYQ>
.
|
This adds SHA-512, which is based on the current SHA-256 code, with the small changes to accommodate the differences between both message digests. I left the license headers basically the same with updated copyright year.
The main reason for adding this is because ed25519 requires the use of SHA-512, and we support ed25519 signature checking in https://github.com/JuulLabs-OSS/mcuboot/, but it currently depends on mbedTLS. With this change it would be possible to build ed25519 validation with our bundled Tinycrypt.