/*!
 * @file        user_aes256_config.c
 *
 * @brief       AES256 configurations
 *
 * @version     V1.0.0
 *
 * @date        2026-03-25
 *
 * @attention
 *
 *  Copyright (C) 2026 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (Geehy Semiconductor Software License Agreement).
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
 *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the Geehy Semiconductor Software License Agreement for the governing permissions
 *  and limitations under the License.
 */

/* Includes */
#include "user_aes256_config.h"

/** @addtogroup Examples
  @{
*/

/** @addtogroup AES256_Examples
  @{
*/

/** @addtogroup AES256_AllModes
  @{
*/

/** @defgroup AES256_AllModes_Variables Variables
  @{
*/

/* AES Keys  */
static const uint32_t Aes256Key128[4] = {0x2B7E1516U, 0x28AED2A6U, 0xABF71588U, 0x09CF4F3CU};
static const uint32_t Aes256Key192[6] = {0x8E73B0F7U, 0xDA0E6452U, 0xC810F32BU, 0x809079E5U,
                                         0x62F8EAD2U, 0x522C6B7BU};
static const uint32_t Aes256Key256[8] = {0x603DEB10U, 0x15CA71BEU, 0x2B73AEF0U, 0x857D7781U,
                                         0x1F352C07U, 0x3B6108D7U, 0x2D9810A3U, 0x0914DFF4U};

/*Initialization Vector*/
static const uint32_t Aes256IV_CBC[4] = {0x00010203U, 0x04050607U, 0x08090A0BU, 0x0C0D0E0FU};
static const uint32_t Aes256IV_CTR[4] = {0xF0F1F2F3U, 0xF4F5F6F7U, 0xF8F9FAFBU, 0xFCFDFEFFU};
static const uint32_t Aes256IV_CMAC[4] = {0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U};

/* Plaintext */
uint32_t g_aes256Plaintext[16]        = {0x6BC1BEE2U, 0x2E409F96U, 0xE93D7E11U, 0x7393172AU,
                                         0xAE2D8A57U, 0x1E03AC9CU, 0x9EB76FACU, 0x45AF8E51U,
                                         0x30C81C46U, 0xA35CE411U, 0xE5FBC119U, 0x1A0A52EFU,
                                         0xF69F2445U, 0xDF4F9B17U, 0xAD2B417BU, 0xE66C3710U};
const uint8_t AES256_PLAINTEXT_CMAC[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
uint32_t g_aes256PlaintextMpc[12]     = {0x6BC1BEE2U, 0x2E409F96U, 0xE93D7E11U, 0x7393172AU,
                                         0xAE2D8A57U, 0x1E03AC9CU, 0x9EB76FACU, 0x45AF8E51U,
                                         0x80000000U, 0x00000000U, 0x00000000U, 0x00000100U};

/* Expected CMAC Ciphertext with AESKey256 */
uint32_t g_aes256CiphertextCmac256[4] = {0x50DC48F8U, 0x5F1E9C4AU, 0x92095E48U, 0x872C69EFU};

/* Expected MPC Ciphertext with AESKey256 */
uint32_t g_aes256CiphertextMpc[4]     = {0xC7277A0DU, 0xC1FB853BU, 0x5F4D9CBDU, 0x26BE40C6U};

/* Used for storing Encrypted text */
uint32_t g_aes256Encryptedtext[16]          = {0};

/* Used for storing Decrypted text */
uint32_t g_aes256Decryptedtext[16]          = {0};

/* Configurations for the AES256 controller of ECB mode*/
Aes256_HandleType g_aes256EcbHandle = {
    .init.mode      = AES256_MODE_ECB,
    .init.bigEndian = AES256_LITTLE_ENDIAN,
    .init.keySize   = AES256_KEYSIZE_128B,
    .init.keyPtr      = Aes256Key128,
    .init.dataWidthUnit = AES256_DATAWIDTHUNIT_WORD,
};

/* Configurations for the AES256 controller of CBC mode*/
Aes256_HandleType g_aes256CbcHandle = {
    .init.mode = AES256_MODE_CBC,
    .init.bigEndian = AES256_LITTLE_ENDIAN,
    .init.keySize = AES256_KEYSIZE_192B,
    .init.keyPtr = Aes256Key192,
    .init.initVectPtr = Aes256IV_CBC,
    .init.dataWidthUnit = AES256_DATAWIDTHUNIT_WORD,
};

/* Configurations for the AES256 controller of CTR mode*/
Aes256_HandleType g_aes256CtrHandle = {
    .init.mode = AES256_MODE_CTR,
    .init.bigEndian = AES256_LITTLE_ENDIAN,
    .init.keySize = AES256_KEYSIZE_256B,
    .init.keyPtr = Aes256Key256,
    .init.initVectPtr = Aes256IV_CTR,
    .init.dataWidthUnit = AES256_DATAWIDTHUNIT_WORD,
};

/* Configurations for the AES256 controller of CMAC mode*/
Aes256_HandleType g_aes256CmacHandle = {
    .init.mode = AES256_MODE_CMAC,
    .init.bigEndian = AES256_LITTLE_ENDIAN,
    .init.keySize = AES256_KEYSIZE_256B,
    .init.keyPtr = Aes256Key256,
    .init.initVectPtr = Aes256IV_CMAC,
};

/* Configurations for the AES256 controller of MPC mode*/
Aes256_HandleType g_aes256MpcHandle = {
    .init.mode = AES256_MODE_MPC,
    .init.bigEndian = AES256_LITTLE_ENDIAN,
    .init.dataWidthUnit = AES256_DATAWIDTHUNIT_WORD,
};

/**@} end of group AES256_AllModes_Variables*/
/**@} end of group AES256_AllModes*/
/**@} end of group AES256_Examples*/
/**@} end of group Examples*/
