Home
last modified time | relevance | path

Searched refs:upg_head (Results 1 - 11 of 11) sorted by relevance

/device/soc/hisilicon/hi3861v100/sdk_liteos/boot/flashboot/upg/
H A Dboot_upg_check_secure.c208 hi_u32 boot_upg_set_key(HI_CONST hi_upg_head *upg_head, hi_u8 *key2, hi_u32 key_length) in boot_upg_set_key() argument
213 if (upg_head->common.param.sign_alg == HI_MODE_ECC) { in boot_upg_set_key()
214 cs = (uintptr_t)key2 ^ ECC_256_LEN ^ (uintptr_t)((hi_u8 *)upg_head + key2_offset) ^ ECC_256_LEN; in boot_upg_set_key()
215 memcpy_s(key2, key_length, (hi_u8 *)upg_head + key2_offset, ECC_256_LEN, cs); in boot_upg_set_key()
218 (uintptr_t)((hi_u8 *)upg_head + key2_offset) ^ RSA_EXP_E_LEN; in boot_upg_set_key()
219 memcpy_s(key2 + key_length - RSA_EXP_E_LEN, RSA_EXP_E_LEN, (hi_u8 *)upg_head + key2_offset, RSA_EXP_E_LEN, cs); in boot_upg_set_key()
224 hi_void boot_upg_set_secure_verify_param(upg_verify_param *param, hi_u32 flash_addr, HI_CONST hi_upg_head *upg_head) in boot_upg_set_secure_verify_param() argument
226 param->flash_addr[0] = (uintptr_t)flash_addr + upg_head->common.section_offset; in boot_upg_set_secure_verify_param()
233 param->flash_addr[2] = flash_addr + upg_head->common.section_offset + in boot_upg_set_secure_verify_param()
235 param->total_size[2] = upg_head in boot_upg_set_secure_verify_param()
248 boot_upg_secure_verify_code(hi_u32 flash_addr, HI_CONST hi_upg_head *upg_head) boot_upg_secure_verify_code() argument
290 boot_upg_unsecure_verify_code(hi_u32 flash_addr, HI_CONST hi_upg_head *upg_head) boot_upg_unsecure_verify_code() argument
338 boot_upg_secure_verify_head(hi_upg_head *upg_head) boot_upg_secure_verify_head() argument
381 boot_upg_unsecure_verify_head(hi_upg_head *upg_head) boot_upg_unsecure_verify_head() argument
401 boot_upg_check_secure_info(hi_u32 flash_addr, hi_upg_head *upg_head) boot_upg_check_secure_info() argument
417 boot_upg_check_unsecure_info(hi_u32 flash_addr, hi_upg_head *upg_head) boot_upg_check_unsecure_info() argument
[all...]
H A Dboot_upg_check_secure.h61 hi_u32 boot_upg_check_secure_info(hi_u32 flash_addr, hi_upg_head *upg_head);
62 hi_u32 boot_upg_check_unsecure_info(hi_u32 flash_addr, hi_upg_head *upg_head);
64 hi_u32 boot_upg_secure_verify_head(hi_upg_head *upg_head);
65 hi_u32 boot_upg_unsecure_verify_head(hi_upg_head *upg_head);
H A Dboot_upg_check.c224 hi_upg_head *upg_head = (hi_upg_head *)boot_malloc(sizeof(hi_upg_head)); in boot_upg_check_file() local
226 if (upg_head == HI_NULL) { in boot_upg_check_file()
229 ret = hi_flash_read(flash_addr, sizeof(hi_upg_head), (hi_u8 *)upg_head); in boot_upg_check_file()
233 hi_upg_common_head *common_head = &(upg_head->common); in boot_upg_check_file()
244 ret = boot_upg_check_secure_info(flash_addr, upg_head); in boot_upg_check_file()
246 ret = boot_upg_check_unsecure_info(flash_addr, upg_head); in boot_upg_check_file()
253 boot_upg_mem_free(upg_head); in boot_upg_check_file()
H A Dboot_upg_tool.c230 hi_u32 boot_upg_lzma_secure_verify_code(const hi_upg_file_head *upg_head, hi_u8 *hash, hi_u32 hash_size) in boot_upg_lzma_secure_verify_code() argument
234 hi_u32 key_length = (upg_head->common.param.sign_alg == HI_MODE_ECC) ? ECC_256_LEN : RSA_2048_LEN; in boot_upg_lzma_secure_verify_code()
245 if (upg_head->common.param.sign_alg == HI_MODE_ECC) { in boot_upg_lzma_secure_verify_code()
246 cs = (uintptr_t)key_e ^ ECC_256_LEN ^ (uintptr_t)((hi_u8 *)upg_head + key2_offset) ^ ECC_256_LEN; in boot_upg_lzma_secure_verify_code()
247 (hi_void) memcpy_s(key_e, key_length, (hi_u8 *)upg_head + key2_offset, ECC_256_LEN, cs); in boot_upg_lzma_secure_verify_code()
250 (uintptr_t)((hi_u8 *)upg_head + key2_offset) ^ RSA_EXP_E_LEN; in boot_upg_lzma_secure_verify_code()
252 (hi_u8 *)upg_head + key2_offset, RSA_EXP_E_LEN, cs); in boot_upg_lzma_secure_verify_code()
256 param.key_n = (hi_u8 *)upg_head + sizeof(hi_upg_common_head); in boot_upg_lzma_secure_verify_code()
259 param.sign = (hi_u8 *)upg_head + sizeof(hi_upg_head) + sizeof(hi_upg_section_head); in boot_upg_lzma_secure_verify_code()
260 param.pad_mode = (hi_padding_mode)upg_head in boot_upg_lzma_secure_verify_code()
268 boot_upg_lzma_unsecure_verify_code(const hi_upg_file_head *upg_head, hi_u8 *hash, hi_u32 hash_size) boot_upg_lzma_unsecure_verify_code() argument
[all...]
/device/soc/hisilicon/hi3861v100/sdk_liteos/platform/system/upg/
H A Dupg_check_secure.c184 hi_void upg_get_subkey(hi_u8 *key, hi_u32 key_length, HI_CONST hi_upg_head *upg_head) in upg_get_subkey() argument
188 if (upg_head->common.param.sign_alg == HI_MODE_ECC) { in upg_get_subkey()
189 if (memcpy_s(key, key_length, (hi_u8 *)upg_head + key2_offset, ECC_256_LEN) != EOK) { in upg_get_subkey()
193 if (memcpy_s(key + key_length - RSA_EXP_E_LEN, RSA_EXP_E_LEN, (hi_u8 *)upg_head + key2_offset, RSA_EXP_E_LEN) in upg_get_subkey()
251 hi_u32 upg_check_upg_file_code(hi_u32 flash_addr, hi_upg_head *upg_head) in upg_check_upg_file_code() argument
253 hi_upg_common_head *head = &(upg_head->common); in upg_check_upg_file_code()
279 upg_get_subkey(key2, key_length, upg_head); in upg_check_upg_file_code()
283 param.key_n = (hi_u8 *)upg_head + sizeof(hi_upg_common_head); in upg_check_upg_file_code()
301 hi_u32 upg_check_upg_file_head(hi_upg_head *upg_head) in upg_check_upg_file_head() argument
303 hi_upg_common_head *head = &(upg_head in upg_check_upg_file_head()
349 upg_check_upg_file(hi_u32 flash_addr, hi_upg_head *upg_head) upg_check_upg_file() argument
[all...]
H A Dupg_check_secure.h52 hi_u32 upg_check_upg_file_code(hi_u32 flash_addr, hi_upg_head *upg_head);
53 hi_u32 upg_check_upg_file_head(hi_upg_head *upg_head);
54 hi_u32 upg_check_upg_file(hi_u32 flash_addr, hi_upg_head *upg_head);
H A Dupg_check_file.c341 hi_upg_head *upg_head = (hi_upg_head *)hi_malloc(HI_MOD_ID_UPG, sizeof(hi_upg_head)); in upg_verify_file() local
345 if (upg_head == HI_NULL) { in upg_verify_file()
348 ret = hi_flash_read(addr, sizeof(hi_upg_head), (hi_u8 *)upg_head); in upg_verify_file()
353 common_head = &(upg_head->common); in upg_verify_file()
354 ret = upg_check_upg_file(addr, upg_head); in upg_verify_file()
375 upg_mem_free(upg_head); in upg_verify_file()
H A Dkernel_crypto.c567 hi_upg_head *upg_head = (hi_upg_head *)hi_malloc(HI_MOD_ID_CRYPTO, sizeof(hi_upg_head)); in crypto_init_param() local
568 if (upg_head == HI_NULL) { in crypto_init_param()
571 ret = hi_flash_read(kernel_start, sizeof(hi_upg_head), (hi_u8 *)upg_head); in crypto_init_param()
580 ret = (hi_u32)memcpy_s(para->upg_salt, IV_BYTE_LENGTH, upg_head->common.aes_key, IV_BYTE_LENGTH); in crypto_init_param()
584 ret = (hi_u32)memcpy_s(para->upg_iv, IV_BYTE_LENGTH, upg_head->common.aes_iv, IV_BYTE_LENGTH); in crypto_init_param()
595 crypto_mem_free(upg_head); in crypto_init_param()
H A Dupg_common.c533 hi_upg_head *upg_head = hi_malloc(HI_MOD_ID_UPG, sizeof(hi_upg_head)); in upg_check_head() local
534 if (upg_head == HI_NULL) { in upg_check_head()
537 ret = hi_flash_read(addr, sizeof(hi_upg_head), (hi_u8 *)upg_head); in upg_check_head()
539 upg_mem_free(upg_head); in upg_check_head()
543 ret = upg_check_upg_file_head(upg_head); in upg_check_head()
545 upg_mem_free(upg_head); in upg_check_head()
/device/soc/hisilicon/hi3861v100/sdk_liteos/boot/flashboot/secure/
H A Dcrypto.c51 hi_upg_head upg_head; in crypto_check_kernel_file() local
52 ret = hi_flash_read(addr_start, sizeof(hi_upg_head), (hi_u8 *)&upg_head); in crypto_check_kernel_file()
56 hi_upg_common_head *common_head = &(upg_head.common); in crypto_check_kernel_file()
923 hi_upg_common_head *upg_head = (hi_upg_common_head *)boot_malloc(sizeof(hi_upg_common_head)); in decrypt_para_init() local
924 if (upg_head == HI_NULL) { in decrypt_para_init()
928 ret = hi_flash_read(addr_write, sizeof(hi_upg_common_head), (hi_u8 *)upg_head); in decrypt_para_init()
938 hi_u32 cs = (uintptr_t)(para->upg_salt) ^ IV_BYTE_LENGTH ^ (uintptr_t)(upg_head->aes_key) ^ in decrypt_para_init()
939 sizeof(upg_head->aes_key); in decrypt_para_init()
940 ret = memcpy_s((hi_void *)(para->upg_salt), IV_BYTE_LENGTH, (hi_void *)(upg_head->aes_key), in decrypt_para_init()
941 sizeof(upg_head in decrypt_para_init()
[all...]
/device/soc/hisilicon/hi3861v100/sdk_liteos/components/at/src/
H A Dat_general.c253 hi_upg_head *upg_head = (hi_upg_head *)hi_malloc(HI_MOD_ID_SAL_DFX, sizeof(hi_upg_head)); in factory_check_file() local
254 if (upg_head == HI_NULL) { in factory_check_file()
258 ret = hi_flash_read(flash_addr, sizeof(hi_upg_head), (hi_u8 *)upg_head); in factory_check_file()
260 hi_free(HI_MOD_ID_SAL_DFX, upg_head); in factory_check_file()
264 hi_upg_common_head *common_head = &(upg_head->common); in factory_check_file()
267 hi_free(HI_MOD_ID_SAL_DFX, upg_head); in factory_check_file()

Completed in 13 milliseconds