mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
image-sig: use designated initializers for algorithm
Designated initializers are more readable because we do not have to check the order in the struct definitions. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
79df00fdb4
commit
8ec87df376
1 changed files with 22 additions and 22 deletions
|
@ -32,42 +32,42 @@ void *image_get_host_blob(void)
|
||||||
|
|
||||||
struct checksum_algo checksum_algos[] = {
|
struct checksum_algo checksum_algos[] = {
|
||||||
{
|
{
|
||||||
"sha1",
|
.name = "sha1",
|
||||||
SHA1_SUM_LEN,
|
.checksum_len = SHA1_SUM_LEN,
|
||||||
SHA1_DER_LEN,
|
.der_len = SHA1_DER_LEN,
|
||||||
sha1_der_prefix,
|
.der_prefix = sha1_der_prefix,
|
||||||
#if IMAGE_ENABLE_SIGN
|
#if IMAGE_ENABLE_SIGN
|
||||||
EVP_sha1,
|
.calculate_sign = EVP_sha1,
|
||||||
#endif
|
#endif
|
||||||
hash_calculate,
|
.calculate = hash_calculate,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sha256",
|
.name = "sha256",
|
||||||
SHA256_SUM_LEN,
|
.checksum_len = SHA256_SUM_LEN,
|
||||||
SHA256_DER_LEN,
|
.der_len = SHA256_DER_LEN,
|
||||||
sha256_der_prefix,
|
.der_prefix = sha256_der_prefix,
|
||||||
#if IMAGE_ENABLE_SIGN
|
#if IMAGE_ENABLE_SIGN
|
||||||
EVP_sha256,
|
.calculate_sign = EVP_sha256,
|
||||||
#endif
|
#endif
|
||||||
hash_calculate,
|
.calculate = hash_calculate,
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct crypto_algo crypto_algos[] = {
|
struct crypto_algo crypto_algos[] = {
|
||||||
{
|
{
|
||||||
"rsa2048",
|
.name = "rsa2048",
|
||||||
RSA2048_BYTES,
|
.key_len = RSA2048_BYTES,
|
||||||
rsa_sign,
|
.sign = rsa_sign,
|
||||||
rsa_add_verify_data,
|
.add_verify_data = rsa_add_verify_data,
|
||||||
rsa_verify,
|
.verify = rsa_verify,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"rsa4096",
|
.name = "rsa4096",
|
||||||
RSA4096_BYTES,
|
.key_len = RSA4096_BYTES,
|
||||||
rsa_sign,
|
.sign = rsa_sign,
|
||||||
rsa_add_verify_data,
|
.add_verify_data = rsa_add_verify_data,
|
||||||
rsa_verify,
|
.verify = rsa_verify,
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue