1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * Copyright (c) 2019, Softathome
4 */
5
6 #ifndef _AES_H
7 #define _AES_H
8
9 #include <errno.h>
10 #include <image.h>
11
12 #if IMAGE_ENABLE_ENCRYPT
13 int image_aes_encrypt(struct image_cipher_info *info,
14 const unsigned char *data, int size,
15 unsigned char **cipher, int *cipher_len);
16 int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest);
17 #else
image_aes_encrypt(struct image_cipher_info * info,const unsigned char * data,int size,unsigned char ** cipher,int * cipher_len)18 int image_aes_encrypt(struct image_cipher_info *info,
19 const unsigned char *data, int size,
20 unsigned char **cipher, int *cipher_len)
21 {
22 return -ENXIO;
23 }
24
image_aes_add_cipher_data(struct image_cipher_info * info,void * keydest)25 int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest)
26 {
27 return -ENXIO;
28 }
29 #endif /* IMAGE_ENABLE_ENCRYPT */
30
31 #if IMAGE_ENABLE_DECRYPT
32 int image_aes_decrypt(struct image_cipher_info *info,
33 const void *cipher, size_t cipher_len,
34 void **data, size_t *size);
35 #else
image_aes_decrypt(struct image_cipher_info * info,const void * cipher,size_t cipher_len,void ** data,size_t * size)36 int image_aes_decrypt(struct image_cipher_info *info,
37 const void *cipher, size_t cipher_len,
38 void **data, size_t *size)
39 {
40 return -ENXIO;
41 }
42 #endif /* IMAGE_ENABLE_DECRYPT */
43
44 #endif
45