ta/wallet_ta.c
/** Wrapper of ripemd_160_internal() for a command of the CA.
  * \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.
  * \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 ripemd_160_internal() for a command of the CA.
\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.
\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 ripemd_160_internal () for a command of the CA . \ 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 . \ 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 ripemd_160(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_INPUT,
							TEE_PARAM_TYPE_MEMREF_OUTPUT,
							TEE_PARAM_TYPE_NONE,
							TEE_PARAM_TYPE_NONE);
	if (param_types != exp_param_types
	 || params[0].memref.buffer == NULL
	 || params[1].memref.buffer == NULL)
		return TEE_ERROR_BAD_PARAMETERS;
	(void)&session_data;
	ripemd_160_internal(
			(uint8_t*)(params[0].memref.buffer),
			(uint32_t)(params[0].memref.size),
			(uint32_t*)(params[1].memref.buffer));
	return result;
}
static TEE_Result ripemd_160 ( 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_INPUT , TEE_PARAM_TYPE_MEMREF_OUTPUT , TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE ) ; if ( param_types != exp_param_types || params [ 0 ] . memref . buffer == NULL || params [ 1 ] . memref . buffer == NULL ) return TEE_ERROR_BAD_PARAMETERS ; ( void ) & session_data ; ripemd_160_internal ( ( uint8_t * ) ( params [ 0 ] . memref . buffer ) , ( uint32_t ) ( params [ 0 ] . memref . size ) , ( uint32_t * ) ( params [ 1 ] . memref . buffer ) ) ; return result ; }
Wrapper of ripemd_160_internal() for a command of the CA.
Wrapper of ripemd_160_internal () for a command of the CA .
/*
     * Expected:
     * [IN]  params[0].memref.buffer -> Source data to hash.
     * [IN]  params[0].memref.size   -> Size of the source data.
     * [OUT] params[1].memref.buffer -> Destination data of the hash.
     * [OUT]  params[1].memref.size   -> Size of destination data.
     */ /* Some sanity checks */ /* Call the internal function to perform the operation */