-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
imgtool: Add support for calculating SHA512
The adds support for hashing image with SHA512. The change has been added to natively support ED25519 signature where SHA512 is used as hashing function. Previously the SHA256 has been calculated on image and then passed to ED25519 signing function, which would then calculate own SHA512 on the SHA256 of an image; that was not correct approach but it has been left supported as is, but now when SHA512 is selected the imgtool will not calculate SHA256 and pass it to ED25519, instead it will calculate SHA512 for TLV but pass image to ED25519 directly which will calcualte own SHA512 (same value) and sign it. Generally previously ED25519 signature did ED25529(SHA512(SHA256(image))) now when SHA512 is selected it does: ED25519(SHA512(image)) To support above --sha parameter has been added that can take value: auto, 256, 384, 512 to select sha, where auto brings the default behaviour, or current, behaviour. The sha provided here is tested against key so not all combinations are supported. Signed-off-by: Dominik Ermel <[email protected]>
- Loading branch information
Showing
2 changed files
with
115 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters