tools/header_generation/create_hdr_esbc/taal_api/esbc_hdr_ta_3_x.c
/****************************************************************************
 * API's for Calculating Image Hash
 ****************************************************************************/
API's for Calculating Image Hash
API ' s for Calculating Image Hash
int calc_img_hash_ta_3_x(void)
{
	int ret;
	uint8_t ctx[CRYPTO_HASH_CTX_SIZE];
	crypto_hash_init(ctx);
	crypto_hash_update(ctx, gd.hdr_struct, gd.hdr_size);
	if (gd.iek_flag == 0)
		crypto_hash_update(ctx, gd.key_table, gd.srk_size);
	ret = crypto_hash_update_file(ctx, gd.entries[0].name);
	if (ret == FAILURE)
		return ret;
	crypto_hash_final(gd.img_hash, ctx);
	return SUCCESS;
}
int calc_img_hash_ta_3_x ( void ) { int ret ; uint8_t ctx [ CRYPTO_HASH_CTX_SIZE ] ; crypto_hash_init ( ctx ) ; crypto_hash_update ( ctx , gd . hdr_struct , gd . hdr_size ) ; if ( gd . iek_flag == 0 ) crypto_hash_update ( ctx , gd . key_table , gd . srk_size ) ; ret = crypto_hash_update_file ( ctx , gd . entries [ 0 ] . name ) ; if ( ret == FAILURE ) return ret ; crypto_hash_final ( gd . img_hash , ctx ) ; return SUCCESS ; }
API's for Calculating Image Hash
API ' s for Calculating Image Hash