ta/wallet_ta.c
/** Resets the operation state before initialization BUT after the key has been
  * set.
  * \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.
  */
Resets the operation state before initialization BUT after the key has been
set.
\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.
Resets the operation state before initialization BUT after the key has been set . \ 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 sha256_init(Session_data * session_data, uint32_t param_types, TEE_Param params[4])
{
	int sha_op_selc;
	uint32_t exp_param_types;
	exp_param_types = TEE_PARAM_TYPES(
							TEE_PARAM_TYPE_VALUE_INPUT,
							TEE_PARAM_TYPE_NONE,
							TEE_PARAM_TYPE_NONE,
							TEE_PARAM_TYPE_NONE);
	if (exp_param_types != param_types)
		return TEE_ERROR_BAD_PARAMETERS;
	sha_op_selc = (int)(params[0].value.a);
	switch (sha_op_selc)
    {
        case 1:
            TEE_ResetOperation(*(session_data->sha_op1));
            break;
        case 2:
            TEE_ResetOperation(*(session_data->sha_op2));
            break;
        case 3:
            TEE_ResetOperation(*(session_data->sha_op3));
            break;
        case 4:
            TEE_ResetOperation(*(session_data->sha_op4));
            break;
        default:
            return TEE_ERROR_BAD_PARAMETERS;
    };
	return TEE_SUCCESS;
}
static TEE_Result sha256_init ( Session_data * session_data , uint32_t param_types , TEE_Param params [ 4 ] ) { int sha_op_selc ; uint32_t exp_param_types ; exp_param_types = TEE_PARAM_TYPES ( TEE_PARAM_TYPE_VALUE_INPUT , TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE ) ; if ( exp_param_types != param_types ) return TEE_ERROR_BAD_PARAMETERS ; sha_op_selc = ( int ) ( params [ 0 ] . value . a ) ; switch ( sha_op_selc ) { case 1 : TEE_ResetOperation ( * ( session_data -> sha_op1 ) ) ; break ; case 2 : TEE_ResetOperation ( * ( session_data -> sha_op2 ) ) ; break ; case 3 : TEE_ResetOperation ( * ( session_data -> sha_op3 ) ) ; break ; case 4 : TEE_ResetOperation ( * ( session_data -> sha_op4 ) ) ; break ; default : return TEE_ERROR_BAD_PARAMETERS ; } ; return TEE_SUCCESS ; }
Resets the operation state before initialization BUT after the key has been
 set.
Resets the operation state before initialization BUT after the key has been set .
/*
     * Expected:
     * [IN]  params[0].value.a -> SHA operation handler number.
     */ /* Sanity check on the parameters received */ /* Get the desired SHA-256 operation handle number */ /* Reset operation accordingly */