/*!
 * @file        user_sha256_config.c
 *
 * @brief       SHA256 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_sha256_config.h"

/** @addtogroup Examples
  @{
*/

/** @addtogroup SHA256_Examples
  @{
*/

/** @addtogroup HASH_SHA2
  @{
*/

/** @defgroup HASH_SHA2_INT_Variables INT_Variables
  @{
*/

uint8_t SHA256_OUTPUT[32] = {0};
const uint8_t SHA256_PAD_INIT_MODE_INPUT[57]            = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
const uint8_t SHA256_PAD_NONEINIT_MODE_INPUT[4]         = "abc";
const uint8_t SHA256_NONEPAD_INIT_MODE_INPUT[65]        = "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd";
const uint8_t SHA256_NONEPAD_NONEINIT_MODE_INPUT[65]    = "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd";

const uint32_t SHA256_PAD_NONEINIT_MODE_IV[8]         = {0x6A09E667U, 0xBB67AE85U, 0x3C6EF372U, 0xA54FF53AU,
                                                         0x510E527FU, 0x9B05688CU, 0x1F83D9ABU, 0x5BE0CD19U};
const uint32_t SHA256_NONEPAD_NONEINIT_MODE_IV[8]     = {0x867D9811U, 0x862DBDABU, 0x2F8FA343U, 0xE3E841DFU,
                                                         0x7DB2DED4U, 0x33172800U, 0xB0369E87U, 0x41EC70DAU};
const uint8_t SHA256_PAD_INIT_MODE_OUTPUT[32]         = {0x24, 0x8D, 0x6A, 0x61, 0xD2, 0x06, 0x38, 0xB8,
                                                         0xE5, 0xC0, 0x26, 0x93, 0x0C, 0x3E, 0x60, 0x39,
                                                         0xA3, 0x3C, 0xE4, 0x59, 0x64, 0xFF, 0x21, 0x67,
                                                         0xF6, 0xEC, 0xED, 0xD4, 0x19, 0xDB, 0x06, 0xC1};
const uint8_t SHA256_PAD_NONEINIT_MODE_OUTPUT[32]     = {0xBA, 0x78, 0x16, 0xBF, 0x8F, 0x01, 0xCF, 0xEA,
                                                         0x41, 0x41, 0x40, 0xDE, 0x5D, 0xAE, 0x22, 0x23,
                                                         0xB0, 0x03, 0x61, 0xA3, 0x96, 0x17, 0x7A, 0x9C,
                                                         0xB4, 0x10, 0xFF, 0x61, 0xF2, 0x00, 0x15, 0xAD};
const uint8_t SHA256_NONEPAD_INIT_MODE_OUTPUT[32]     = {0x86, 0x7D, 0x98, 0x11, 0x86, 0x2D, 0xBD, 0xAB,
                                                         0x2F, 0x8F, 0xA3, 0x43, 0xE3, 0xE8, 0x41, 0xDF,
                                                         0x7D, 0xB2, 0xDE, 0xD4, 0x33, 0x17, 0x28, 0x00,
                                                         0xB0, 0x36, 0x9E, 0x87, 0x41, 0xEC, 0x70, 0xDA};
const uint8_t SHA256_NONEPAD_NONEINIT_MODE_OUTPUT[32] = {0x7F, 0x3B, 0x90, 0x8E,
                                                         0x2D, 0x9E, 0x70, 0x1B,
                                                         0x29, 0xF4, 0x6F, 0x62,
                                                         0x6B, 0x56, 0xFD, 0xBC,
                                                         0xEE, 0x9F, 0x06, 0x8F,
                                                         0x02, 0xC6, 0x96, 0x84,
                                                         0x9D, 0xD4, 0x2C, 0xC6,
                                                         0xB4, 0xD7, 0xBB, 0xD3};

/* Configurations for the SHA256 controller */
Sha256_InitType g_sha256PadInitModeConfig = {
    .iniMode = SHA256_INI_MODE,
    .padMode = SHA256_PAD_MODE,
};

Sha256_InitType g_sha256PadNoneInitModeConfig = {
    .iniMode = SHA256_NONE_INI_MODE,
    .padMode = SHA256_PAD_MODE,
    .ivPtr = SHA256_PAD_NONEINIT_MODE_IV,
};

Sha256_InitType g_sha256NonePadInitModeConfig = {
    .iniMode = SHA256_INI_MODE,
    .padMode = SHA256_NONE_PAD_MODE,
};

Sha256_InitType g_sha256NonePadNoneInitModeConfig = {
    .iniMode = SHA256_NONE_INI_MODE,
    .padMode = SHA256_NONE_PAD_MODE,
    .ivPtr = SHA256_NONEPAD_NONEINIT_MODE_IV,
};

/**@} end of group HASH_SHA2_INT_Variables */
/**@} end of group HASH_SHA2 */
/**@} end of group SHA256_Examples */
/**@} end of group Examples */
