diff options
| author | Tom Rini <[email protected]> | 2020-01-17 13:23:32 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2020-01-17 13:23:32 -0500 |
| commit | 2d2f91a480f6849a8548414003d36fa030d434f1 (patch) | |
| tree | 08667edb96f6a8efde767b10fabceafb746e3af7 /include/u-boot | |
| parent | d7bb6aceb2e99a832efbb96f9bf480bf95602192 (diff) | |
| parent | 4df3578119b043d76b86b50077b06898fc2a4f62 (diff) | |
Merge branch '2020-01-17-improve-aes-support'
- Add support and tests for AES192 and AES256
Diffstat (limited to 'include/u-boot')
| -rw-r--r-- | include/u-boot/aes.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/u-boot/aes.h b/include/u-boot/aes.h new file mode 100644 index 00000000000..32281041de2 --- /dev/null +++ b/include/u-boot/aes.h @@ -0,0 +1,44 @@ +/* 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 */ + +#if IMAGE_ENABLE_DECRYPT +int image_aes_decrypt(struct image_cipher_info *info, + const void *cipher, size_t cipher_len, + void **data, size_t *size); +#else +int image_aes_decrypt(struct image_cipher_info *info, + const void *cipher, size_t cipher_len, + void **data, size_t *size) +{ + return -ENXIO; +} +#endif /* IMAGE_ENABLE_DECRYPT */ + +#endif |
