/***************************************************************************//**
* \file cy_si_keystorage.c
* \version 1.00
*
* \brief
* Secure key storage for the secure image.
*
********************************************************************************
* \copyright
* Copyright 2017-2018, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/

#include "cy_si_keystorage.h"

#if defined(__cplusplus)
extern "C" {
#endif

/** Secure Key Storage (Note: Ensure that the alignment matches the Protection unit configuration) */
CY_ALIGN(1024) __USED const uint8_t CySecureKeyStorage[CY_SI_SECURE_KEY_ARRAY_SIZE][CY_SI_SECURE_KEY_LENGTH] = {
    {0x00u}, /* Insert user key #1 values */
    {0x00u}, /* Insert user key #2 values */
    {0x00u}, /* Insert user key #3 values */
    {0x00u}  /* Insert user key #4 values */
};

/** Public key in SFlash */
CY_SECTION(".cy_sflash_public_key") __USED const cy_si_stc_public_key_t cy_publicKey =
{
    .objSize = sizeof(cy_si_stc_public_key_t),
    .signatureScheme = CY_SI_PUBLIC_KEY_RSA_2048,
    .publicKeyStruct =
    {
        .moduloAddr         = (uint32_t)&(SFLASH->PUBLIC_KEY) + offsetof(cy_si_stc_public_key_t, moduloData),
        .moduloSize         = CY_SI_PUBLIC_KEY_SIZEOF_BYTE * CY_SI_PUBLIC_KEY_MODULOLENGTH,
        .expAddr            = (uint32_t)&(SFLASH->PUBLIC_KEY) + offsetof(cy_si_stc_public_key_t, expData),
        .expSize            = CY_SI_PUBLIC_KEY_SIZEOF_BYTE * CY_SI_PUBLIC_KEY_EXPLENGTH,
        .barrettAddr        = (uint32_t)&(SFLASH->PUBLIC_KEY) + offsetof(cy_si_stc_public_key_t, barrettData),
        .inverseModuloAddr  = (uint32_t)&(SFLASH->PUBLIC_KEY) + offsetof(cy_si_stc_public_key_t, inverseModuloData),
        .rBarAddr           = (uint32_t)&(SFLASH->PUBLIC_KEY) + offsetof(cy_si_stc_public_key_t, rBarData),
    },
    /* Replace key data from this point */
    .moduloData =
    {
        0x0Du, 0x10u, 0x58u, 0x3Fu, 0x4Fu, 0x25u, 0x70u, 0x63u,
        0x6Du, 0x3Bu, 0xE6u, 0x10u, 0x9Eu, 0x7Cu, 0x7Cu, 0x9Cu,
        0x02u, 0x8Bu, 0x43u, 0x07u, 0x61u, 0x91u, 0xF6u, 0xBFu,
        0x12u, 0x7Cu, 0x2Bu, 0xDAu, 0x45u, 0xD5u, 0x75u, 0xBEu,
        0xB5u, 0xF1u, 0xBDu, 0x36u, 0x3Au, 0xC1u, 0xD1u, 0x39u,
        0x20u, 0x11u, 0x99u, 0x22u, 0x2Fu, 0xE8u, 0xFEu, 0x98u,
        0xFBu, 0xCDu, 0x34u, 0xD4u, 0xE2u, 0x2Cu, 0xC5u, 0x7Cu,
        0xC5u, 0x50u, 0x62u, 0xFFu, 0xFDu, 0x61u, 0x14u, 0x90u,
        0xFAu, 0x43u, 0xBDu, 0xADu, 0xA3u, 0xD5u, 0x86u, 0x85u,
        0x4Du, 0xF1u, 0x24u, 0x62u, 0x5Au, 0xECu, 0x87u, 0x4Du,
        0xD0u, 0x18u, 0xB0u, 0xE1u, 0x4Fu, 0x40u, 0xDEu, 0x87u,
        0xBBu, 0x74u, 0xC5u, 0x5Du, 0x48u, 0x90u, 0x26u, 0x68u,
        0x5Cu, 0xECu, 0xC3u, 0x5Cu, 0xC7u, 0x03u, 0x8Au, 0x05u,
        0x2Eu, 0x37u, 0xB8u, 0xA0u, 0x05u, 0xC5u, 0x21u, 0x0Fu,
        0x76u, 0x9Cu, 0xEEu, 0x19u, 0x4Cu, 0x2Eu, 0x89u, 0xA2u,
        0x21u, 0x44u, 0x61u, 0x9Fu, 0x7Fu, 0xD2u, 0x51u, 0x72u,
        0xABu, 0x2Cu, 0xA5u, 0xC6u, 0x7Cu, 0x0Au, 0x9Bu, 0x06u,
        0x14u, 0xECu, 0x91u, 0x3Du, 0x5Eu, 0x08u, 0x71u, 0x6Au,
        0xFEu, 0xABu, 0x3Eu, 0x1Bu, 0x99u, 0x3Cu, 0xF0u, 0x12u,
        0x57u, 0x0Cu, 0xF2u, 0x42u, 0x78u, 0xA5u, 0x3Bu, 0xAAu,
        0x49u, 0x98u, 0x03u, 0x8Eu, 0x0Fu, 0x5Au, 0xC9u, 0xFCu,
        0x26u, 0xC9u, 0x93u, 0xB8u, 0xB8u, 0xEBu, 0x6Fu, 0xF1u,
        0x65u, 0x78u, 0x43u, 0x0Au, 0xE5u, 0xFBu, 0x2Bu, 0xCCu,
        0x8Bu, 0x2Cu, 0x31u, 0x0Du, 0xE1u, 0x49u, 0x06u, 0x25u,
        0xE3u, 0xFAu, 0x92u, 0x7Fu, 0xC7u, 0x96u, 0x35u, 0x17u,
        0x2Cu, 0xEEu, 0xEEu, 0x40u, 0xC1u, 0x18u, 0x1Cu, 0x5Cu,
        0x45u, 0x4Du, 0xE9u, 0xB5u, 0xFDu, 0x23u, 0x60u, 0x14u,
        0x5Fu, 0x78u, 0x88u, 0xB9u, 0x17u, 0xAAu, 0xD5u, 0xB4u,
        0x68u, 0xCCu, 0x5Cu, 0xE2u, 0x3Fu, 0xD7u, 0xD4u, 0x6Eu,
        0x29u, 0x2Au, 0xD7u, 0x6Fu, 0xE8u, 0x89u, 0xCBu, 0xE3u,
        0x97u, 0x54u, 0xBCu, 0x4Eu, 0x85u, 0xA7u, 0x63u, 0xAFu,
        0x8Au, 0xFDu, 0xB8u, 0xF2u, 0x8Bu, 0xA4u, 0x36u, 0xD4u,
    },
    .expData =
    {
        0x01u, 0x00u, 0x01u, 0x00u,
    },
    .barrettData =
    {
        0x44u, 0x94u, 0xA5u, 0xF4u, 0x4Fu, 0xCEu, 0x24u, 0xD0u,
        0x3Bu, 0xDCu, 0x6Eu, 0x1Cu, 0x72u, 0xE8u, 0x6Fu, 0x5Eu,
        0x32u, 0x38u, 0x0Bu, 0xEDu, 0x73u, 0x8Bu, 0x7Cu, 0x1Cu,
        0x8Au, 0x03u, 0x36u, 0x88u, 0xB0u, 0x20u, 0x7Au, 0x90u,
        0x7Bu, 0x0Du, 0x44u, 0xA2u, 0xF2u, 0x21u, 0x4Fu, 0xD9u,
        0xA3u, 0x31u, 0xD8u, 0x87u, 0xD6u, 0xC8u, 0x36u, 0x94u,
        0x9Eu, 0x32u, 0x01u, 0xD6u, 0x18u, 0x2Fu, 0x77u, 0x0Cu,
        0xD6u, 0xAAu, 0x9Bu, 0x15u, 0xD8u, 0x50u, 0x6Eu, 0x88u,
        0xD7u, 0x28u, 0x11u, 0x84u, 0xE3u, 0x7Au, 0x52u, 0x08u,
        0x12u, 0xB8u, 0x05u, 0xECu, 0x70u, 0x1Fu, 0xD7u, 0x0Au,
        0x53u, 0x18u, 0x62u, 0xEBu, 0x37u, 0x16u, 0x04u, 0x6Du,
        0x86u, 0x4Cu, 0x8Au, 0x1Au, 0x6Eu, 0xCEu, 0x5Au, 0xD4u,
        0x8Fu, 0x17u, 0xEBu, 0x20u, 0x03u, 0x36u, 0xACu, 0xDDu,
        0x74u, 0x16u, 0xB4u, 0xE7u, 0x40u, 0x81u, 0x82u, 0x7Bu,
        0x2Fu, 0x31u, 0x95u, 0x64u, 0xFDu, 0x6Eu, 0x75u, 0xB7u,
        0x8Bu, 0xC8u, 0x6Au, 0x5Au, 0x48u, 0x28u, 0x5Du, 0xAEu,
        0x0Au, 0x11u, 0x86u, 0xC0u, 0x5Au, 0x4Du, 0xDBu, 0x3Eu,
        0x85u, 0xCCu, 0xDFu, 0x0Bu, 0x0Eu, 0xCBu, 0x52u, 0xB7u,
        0x45u, 0xACu, 0x42u, 0xC2u, 0x39u, 0x1Fu, 0xE1u, 0x18u,
        0xFDu, 0x7Bu, 0x77u, 0x7Fu, 0xE9u, 0xFCu, 0x25u, 0x8Cu,
        0xB7u, 0x9Eu, 0x38u, 0x6Fu, 0x22u, 0xE6u, 0x6Du, 0xC5u,
        0xB8u, 0x79u, 0x15u, 0x0Fu, 0xD1u, 0xAFu, 0x3Du, 0xC2u,
        0xB1u, 0xD8u, 0x4Fu, 0x81u, 0x09u, 0xB7u, 0x02u, 0xF0u,
        0xCDu, 0x65u, 0xF9u, 0xDFu, 0x0Bu, 0x74u, 0x14u, 0xDEu,
        0x17u, 0xDDu, 0xE6u, 0x85u, 0x19u, 0x7Eu, 0x49u, 0x2Fu,
        0x82u, 0xBAu, 0x73u, 0x1Du, 0x44u, 0x84u, 0x4Du, 0x5Cu,
        0x5Fu, 0x5Bu, 0x6Du, 0x78u, 0x73u, 0xA3u, 0x6Fu, 0x07u,
        0x76u, 0xF3u, 0xCDu, 0x52u, 0xE3u, 0xC3u, 0x89u, 0xE8u,
        0xA6u, 0x8Au, 0xFAu, 0xF5u, 0x21u, 0xC3u, 0x25u, 0x16u,
        0xD5u, 0x10u, 0xFDu, 0x30u, 0x5Du, 0xC5u, 0xB9u, 0xCAu,
        0x2Bu, 0x5Au, 0x92u, 0xEDu, 0xE5u, 0xF4u, 0x3Bu, 0xBFu,
        0x08u, 0x06u, 0x8Au, 0x75u, 0x88u, 0x36u, 0xD2u, 0x34u,
        0x01u, 0x00u, 0x00u, 0x00u,
    },
    .inverseModuloData =
    {
        0x3Bu, 0x41u, 0xE5u, 0xABu, 0xC8u, 0x05u, 0x56u, 0xBFu,
        0xF8u, 0xF5u, 0xE6u, 0x9Au, 0x46u, 0xF3u, 0x01u, 0x17u,
        0xBEu, 0x0Eu, 0x81u, 0x9Bu, 0x54u, 0x2Fu, 0x2Eu, 0x3Du,
        0xCBu, 0xA6u, 0xC3u, 0x35u, 0x02u, 0x18u, 0x38u, 0x1Au,
        0x38u, 0x15u, 0x54u, 0x0Eu, 0xA4u, 0xCDu, 0xD1u, 0xEDu,
        0x10u, 0x8Eu, 0x6Eu, 0xB9u, 0xCDu, 0x2Fu, 0x8Cu, 0xD6u,
        0x56u, 0x95u, 0xE8u, 0x14u, 0x79u, 0xC6u, 0x32u, 0x02u,
        0xA6u, 0x03u, 0xA1u, 0x8Du, 0x26u, 0x47u, 0xA1u, 0x99u,
        0x96u, 0xECu, 0xA3u, 0x77u, 0x22u, 0xEAu, 0x25u, 0x72u,
        0xBCu, 0xB8u, 0x77u, 0xE9u, 0x11u, 0x78u, 0x8Cu, 0x55u,
        0xB9u, 0x8Eu, 0x90u, 0x19u, 0x3Cu, 0xFFu, 0x9Fu, 0x40u,
        0x46u, 0x6Du, 0x51u, 0x22u, 0x21u, 0x15u, 0x5Cu, 0x4Fu,
        0xCAu, 0x15u, 0xB0u, 0xE8u, 0x67u, 0x0Au, 0x2Cu, 0x4Au,
        0xB1u, 0x77u, 0xFAu, 0xE6u, 0x3Cu, 0xA6u, 0x02u, 0x2Fu,
        0x16u, 0x96u, 0xE3u, 0xADu, 0x29u, 0x83u, 0x4Au, 0x88u,
        0xB1u, 0x6Bu, 0x13u, 0x38u, 0xA4u, 0xB0u, 0xE8u, 0xA6u,
        0xDBu, 0xA5u, 0xFBu, 0x36u, 0x7Au, 0x10u, 0xB1u, 0x75u,
        0x93u, 0x00u, 0xECu, 0x2Bu, 0x1Du, 0x86u, 0xE0u, 0x4Fu,
        0x85u, 0xC8u, 0x70u, 0x23u, 0xEBu, 0x96u, 0x87u, 0x70u,
        0x39u, 0x58u, 0x2Du, 0xAEu, 0xC3u, 0xC9u, 0xB6u, 0xFDu,
        0x27u, 0xEEu, 0x5Fu, 0x14u, 0x4Du, 0xB6u, 0xFAu, 0x55u,
        0xC3u, 0x2Cu, 0xFAu, 0x2Au, 0x60u, 0x67u, 0x37u, 0xBAu,
        0xB3u, 0xA0u, 0x17u, 0x9Du, 0x5Cu, 0xDCu, 0x0Au, 0x82u,
        0xFEu, 0x0Eu, 0xC9u, 0xE7u, 0x36u, 0x09u, 0x38u, 0xF3u,
        0xA7u, 0x83u, 0x9Au, 0x71u, 0xD2u, 0x07u, 0x2Bu, 0x4Fu,
        0x4Eu, 0xABu, 0x49u, 0xE8u, 0x0Eu, 0xE0u, 0x1Cu, 0x48u,
        0x73u, 0x87u, 0x62u, 0xC9u, 0x95u, 0x17u, 0xCCu, 0xE6u,
        0xECu, 0x34u, 0x18u, 0xE0u, 0xF0u, 0xCFu, 0x64u, 0x48u,
        0xD9u, 0x92u, 0x1Au, 0x82u, 0x21u, 0x68u, 0xBCu, 0x70u,
        0x31u, 0xA3u, 0xE0u, 0xC9u, 0xAEu, 0xC8u, 0x94u, 0x83u,
        0x4Du, 0x95u, 0x3Bu, 0x4Cu, 0x65u, 0x8Eu, 0xC7u, 0x46u,
        0x91u, 0x3Cu, 0xF4u, 0xD1u, 0x0Bu, 0xA5u, 0x64u, 0x13u,
    },
    .rBarData =
    {
        0xF3u, 0xEFu, 0xA7u, 0xC0u, 0xB0u, 0xDAu, 0x8Fu, 0x9Cu,
        0x92u, 0xC4u, 0x19u, 0xEFu, 0x61u, 0x83u, 0x83u, 0x63u,
        0xFDu, 0x74u, 0xBCu, 0xF8u, 0x9Eu, 0x6Eu, 0x09u, 0x40u,
        0xEDu, 0x83u, 0xD4u, 0x25u, 0xBAu, 0x2Au, 0x8Au, 0x41u,
        0x4Au, 0x0Eu, 0x42u, 0xC9u, 0xC5u, 0x3Eu, 0x2Eu, 0xC6u,
        0xDFu, 0xEEu, 0x66u, 0xDDu, 0xD0u, 0x17u, 0x01u, 0x67u,
        0x04u, 0x32u, 0xCBu, 0x2Bu, 0x1Du, 0xD3u, 0x3Au, 0x83u,
        0x3Au, 0xAFu, 0x9Du, 0x00u, 0x02u, 0x9Eu, 0xEBu, 0x6Fu,
        0x05u, 0xBCu, 0x42u, 0x52u, 0x5Cu, 0x2Au, 0x79u, 0x7Au,
        0xB2u, 0x0Eu, 0xDBu, 0x9Du, 0xA5u, 0x13u, 0x78u, 0xB2u,
        0x2Fu, 0xE7u, 0x4Fu, 0x1Eu, 0xB0u, 0xBFu, 0x21u, 0x78u,
        0x44u, 0x8Bu, 0x3Au, 0xA2u, 0xB7u, 0x6Fu, 0xD9u, 0x97u,
        0xA3u, 0x13u, 0x3Cu, 0xA3u, 0x38u, 0xFCu, 0x75u, 0xFAu,
        0xD1u, 0xC8u, 0x47u, 0x5Fu, 0xFAu, 0x3Au, 0xDEu, 0xF0u,
        0x89u, 0x63u, 0x11u, 0xE6u, 0xB3u, 0xD1u, 0x76u, 0x5Du,
        0xDEu, 0xBBu, 0x9Eu, 0x60u, 0x80u, 0x2Du, 0xAEu, 0x8Du,
        0x54u, 0xD3u, 0x5Au, 0x39u, 0x83u, 0xF5u, 0x64u, 0xF9u,
        0xEBu, 0x13u, 0x6Eu, 0xC2u, 0xA1u, 0xF7u, 0x8Eu, 0x95u,
        0x01u, 0x54u, 0xC1u, 0xE4u, 0x66u, 0xC3u, 0x0Fu, 0xEDu,
        0xA8u, 0xF3u, 0x0Du, 0xBDu, 0x87u, 0x5Au, 0xC4u, 0x55u,
        0xB6u, 0x67u, 0xFCu, 0x71u, 0xF0u, 0xA5u, 0x36u, 0x03u,
        0xD9u, 0x36u, 0x6Cu, 0x47u, 0x47u, 0x14u, 0x90u, 0x0Eu,
        0x9Au, 0x87u, 0xBCu, 0xF5u, 0x1Au, 0x04u, 0xD4u, 0x33u,
        0x74u, 0xD3u, 0xCEu, 0xF2u, 0x1Eu, 0xB6u, 0xF9u, 0xDAu,
        0x1Cu, 0x05u, 0x6Du, 0x80u, 0x38u, 0x69u, 0xCAu, 0xE8u,
        0xD3u, 0x11u, 0x11u, 0xBFu, 0x3Eu, 0xE7u, 0xE3u, 0xA3u,
        0xBAu, 0xB2u, 0x16u, 0x4Au, 0x02u, 0xDCu, 0x9Fu, 0xEBu,
        0xA0u, 0x87u, 0x77u, 0x46u, 0xE8u, 0x55u, 0x2Au, 0x4Bu,
        0x97u, 0x33u, 0xA3u, 0x1Du, 0xC0u, 0x28u, 0x2Bu, 0x91u,
        0xD6u, 0xD5u, 0x28u, 0x90u, 0x17u, 0x76u, 0x34u, 0x1Cu,
        0x68u, 0xABu, 0x43u, 0xB1u, 0x7Au, 0x58u, 0x9Cu, 0x50u,
        0x75u, 0x02u, 0x47u, 0x0Du, 0x74u, 0x5Bu, 0xC9u, 0x2Bu,
    },
    /* End of key data */
};

#if defined(__cplusplus)
}
#endif

/* [] END OF FILE */
