ta/wallet_ta.c
/**
  * Wrapper of ecdsa_serialise_internal() for a CA command. This function is not
  * really needed for the correct functioning of the wallet it is and should
  * only be used for testing purposes.
  * \param session_data A data pointer to a session context.
  * \param param_types The types of the four parameters.
  * \param params A pointer to an array of four parameters.
  * \param params A pointer to an array of four parameters.
  * \return TEE_SUCCESS in case of success otherwise returns the result
  *         received from the failed operation. The information about all
  *         possible returns is present in TEE Client API Specification - 4.4.2
  *         published by GlobalPlatform.
  */
Wrapper of ecdsa_serialise_internal() for a CA command. This function is not
really needed for the correct functioning of the wallet it is and should
only be used for testing purposes.
\param session_data A data pointer to a session context.
\param param_types The types of the four parameters.
\param params A pointer to an array of four parameters.
\param params A pointer to an array of four parameters.
\return TEE_SUCCESS in case of success otherwise returns the result
received from the failed operation. The information about all
possible returns is present in TEE Client API Specification - 4.4.2
published by GlobalPlatform.
Wrapper of ecdsa_serialise_internal () for a CA command . This function is not really needed for the correct functioning of the wallet it is and should only be used for testing purposes . \ param session_data A data pointer to a session context . \ param param_types The types of the four parameters . \ param params A pointer to an array of four parameters . \ param params A pointer to an array of four parameters . \ return TEE_SUCCESS in case of success otherwise returns the result received from the failed operation . The information about all possible returns is present in TEE Client API Specification - 4 . 4 . 2 published by GlobalPlatform .
static TEE_Result ecdsa_serialise(Session_data * session_data, uint32_t param_types, TEE_Param params[4])
{
	TEE_Result result = TEE_SUCCESS;
	uint32_t exp_param_types;
	exp_param_types = TEE_PARAM_TYPES(
							TEE_PARAM_TYPE_MEMREF_OUTPUT,
							TEE_PARAM_TYPE_MEMREF_INPUT,
							TEE_PARAM_TYPE_VALUE_INOUT,
							TEE_PARAM_TYPE_NONE);
	(void)&session_data;
	if (param_types != exp_param_types
		|| params[0].memref.buffer == NULL
		|| params[1].memref.buffer == NULL)
		return TEE_ERROR_BAD_PARAMETERS;
	set_to_g_internal((PointAffine*)(params[0].memref.buffer));
	params[2].value.b = (uint32_t)ecdsa_serialise_internal(
									(uint8_t*)(params[0].memref.buffer),
									(PointAffine*)(params[1].memref.buffer),
									(bool)(params[2].value.a));
	return result;
}
static TEE_Result ecdsa_serialise ( Session_data * session_data , uint32_t param_types , TEE_Param params [ 4 ] ) { TEE_Result result = TEE_SUCCESS ; uint32_t exp_param_types ; exp_param_types = TEE_PARAM_TYPES ( TEE_PARAM_TYPE_MEMREF_OUTPUT , TEE_PARAM_TYPE_MEMREF_INPUT , TEE_PARAM_TYPE_VALUE_INOUT , TEE_PARAM_TYPE_NONE ) ; ( void ) & session_data ; if ( param_types != exp_param_types || params [ 0 ] . memref . buffer == NULL || params [ 1 ] . memref . buffer == NULL ) return TEE_ERROR_BAD_PARAMETERS ; set_to_g_internal ( ( PointAffine * ) ( params [ 0 ] . memref . buffer ) ) ; params [ 2 ] . value . b = ( uint32_t ) ecdsa_serialise_internal ( ( uint8_t * ) ( params [ 0 ] . memref . buffer ) , ( PointAffine * ) ( params [ 1 ] . memref . buffer ) , ( bool ) ( params [ 2 ] . value . a ) ) ; return result ; }
Wrapper of ecdsa_serialise_internal() for a CA command.
Wrapper of ecdsa_serialise_internal () for a CA command .
/*
     * Expected:
     * [OUT] params[0].memref.buffer -> The point to set..
     * [OUT] params[0].memref.size   -> Size of the point to set.
     * [IN]  params[1].memref.buffer -> The point to set..
     * [IN]  params[1].memref.size   -> Size of the point to set.
     * [IN]  params[2].value.a       -> Boolean with info about compression.
     * [OUT] params[2].value.b       -> The number of bytes written to out.
     */ /* Some sanity checks */