mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-04 10:30:50 +09:00
7298e42250
This commit add the support of encrypting image with aes in mkimage. To enable the ciphering, a node cipher with a reference to a key and IV (Initialization Vector) must be added to the its file. Then mkimage add the encrypted image to the FIT and add the key and IV to the u-boot device tree. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
32 lines
718 B
C
32 lines
718 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Copyright (c) 2019, Softathome
|
|
*/
|
|
|
|
#ifndef _AES_H
|
|
#define _AES_H
|
|
|
|
#include <errno.h>
|
|
#include <image.h>
|
|
|
|
#if IMAGE_ENABLE_ENCRYPT
|
|
int image_aes_encrypt(struct image_cipher_info *info,
|
|
const unsigned char *data, int size,
|
|
unsigned char **cipher, int *cipher_len);
|
|
int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest);
|
|
#else
|
|
int image_aes_encrypt(struct image_cipher_info *info,
|
|
const unsigned char *data, int size,
|
|
unsigned char **cipher, int *cipher_len)
|
|
{
|
|
return -ENXIO;
|
|
}
|
|
|
|
int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest)
|
|
{
|
|
return -ENXIO;
|
|
}
|
|
#endif /* IMAGE_ENABLE_ENCRYPT */
|
|
|
|
#endif
|