summaryrefslogtreecommitdiff
path: root/include/u-boot
diff options
context:
space:
mode:
authorStefano Babic <[email protected]>2020-01-20 15:35:43 +0100
committerStefano Babic <[email protected]>2020-01-20 15:36:13 +0100
commit0e78c9181c6460d10255bfb6dc6d1f2d6912717e (patch)
tree871a723fd26e0d04328e2ca361228e7c34c627f6 /include/u-boot
parent9c27310ac23ce1966f9629d73973c458412a0085 (diff)
parent2d2f91a480f6849a8548414003d36fa030d434f1 (diff)
Merge branch 'master' of git://git.denx.de/u-boot
Signed-off-by: Stefano Babic <[email protected]>
Diffstat (limited to 'include/u-boot')
-rw-r--r--include/u-boot/aes.h44
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