blob: 32281041de245278a41ed7c94894405efc5d2da5 [file] [log] [blame]
Philippe Reynes3148e422019-12-18 18:25:41 +01001/* 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
13int image_aes_encrypt(struct image_cipher_info *info,
14 const unsigned char *data, int size,
15 unsigned char **cipher, int *cipher_len);
16int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest);
17#else
18int 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
25int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest)
26{
27 return -ENXIO;
28}
29#endif /* IMAGE_ENABLE_ENCRYPT */
30
Philippe Reynes3d964702019-12-18 18:25:42 +010031#if IMAGE_ENABLE_DECRYPT
32int image_aes_decrypt(struct image_cipher_info *info,
33 const void *cipher, size_t cipher_len,
34 void **data, size_t *size);
35#else
36int 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
Philippe Reynes3148e422019-12-18 18:25:41 +010044#endif