uboot/include/u-boot/aes.h
<<
>>
Prefs
   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
  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                              void *fit, int node_noffset);
  18#else
  19int image_aes_encrypt(struct image_cipher_info *info,
  20                      const unsigned char *data, int size,
  21                      unsigned char **cipher, int *cipher_len)
  22{
  23        return -ENXIO;
  24}
  25
  26int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest,
  27                              void *fit, int node_noffset)
  28{
  29        return -ENXIO;
  30}
  31#endif /* IMAGE_ENABLE_ENCRYPT */
  32
  33#if IMAGE_ENABLE_DECRYPT
  34int image_aes_decrypt(struct image_cipher_info *info,
  35                      const void *cipher, size_t cipher_len,
  36                      void **data, size_t *size);
  37#else
  38int image_aes_decrypt(struct image_cipher_info *info,
  39                      const void *cipher, size_t cipher_len,
  40                      void **data, size_t *size)
  41{
  42        return -ENXIO;
  43}
  44#endif /* IMAGE_ENABLE_DECRYPT */
  45
  46#endif
  47