anchor.diff:  			{next_state, id, NewStateData, ?TIMEOUT}
   	end.
   
  --spec eap_start(Event, From, StateData) -> Result
  -	when
  -		Event :: term(),
  -		From :: {Pid, Tag},
  -		Pid :: pid(),
  -		Tag :: term(),
  -		StateData :: statedata(),
  -		Result :: {reply, Reply, NextStateName, NewStateData}
  -				| {reply, Reply,NextStateName, NewStateData, Timeout}
  -				| {reply, Reply,NextStateName, NewStateData, hibernate}
  -				| {next_state, NextStateName, NewStateData}
  -				| {next_state, NextStateName, NewStateData, Timeout}
  -				| {next_state, NextStateName, NewStateData, hibernate}
  -				| {stop, Reason, Reply, NewStateData} | {stop, Reason, NewStateData},
  -				Reply :: term(),
  -		NextStateName :: atom(),
  -		NewStateData :: statedata(),
  -		Timeout :: pos_integer() | infinity,
  -		Reason :: normal | term().
  -%% @doc Handle events sent with {@link //stdlib/gen_fsm:sync_send_event/2.
  -%%		gen_fsm:sync_send_event/2} and {@link //stdlib/gen_fsm:sync_send_event/3.
  -%%		gen_fsm:sync_send_event/3} in the <b>eap_start</b> state.
  -%% @@see //stdlib/gen_fsm:StateName/3
  -%% @private
  -eap_start(Event, _From, StateData) ->
  -	try crypto:strong_rand_bytes(4) of
  -		Token ->
  -			eap_start2(Token, Event, StateData)
  -	catch
  -		Reason ->
  -			{stop, Reason, StateData}
  -	end.
  -%% @hidden
  -eap_start2(Token, Event, #statedata{eap_id = EapID, session_id = SessionId,
  -		server_id = ServerID, group_desc = GroupDesc, rand_func = RandFunc,
  -		prf = PRF, auth_app_id = AppId, auth_req_type = AuthType,
  -		origin_host = OHost, origin_realm = ORealm} = StateData) ->
  -	EapPwdId = #eap_pwd_id{group_desc = GroupDesc, random_fun = RandFunc,
  -			prf = PRF, token = Token, pwd_prep = none, identity = ServerID},
  -	EapPwdData = ocs_eap_codec:eap_pwd_id(EapPwdId),
  -	EapPwd = #eap_pwd{pwd_exch = id, data = EapPwdData},
  -	EapData = ocs_eap_codec:eap_pwd(EapPwd),
  -	case Event#diameter_eap_app_DER.'EAP-Payload' of
  -		[] ->
  -			EapPacket = #eap_packet{code = request,
  -					type = ?PWD, identifier = EapID, data = EapData},
  -			Answer = generate_diameter_response(SessionId, AuthType,
  -					?'DIAMETER_BASE_RESULT-CODE_MULTI_ROUND_AUTH', OHost, ORealm, EapPacket),
  -			{reply, Answer, id, StateData, ?TIMEOUT};
  -		EapMessage ->
  -			case catch ocs_eap_codec:eap_packet(EapMessage) of
  -				#eap_packet{code = response, type = ?Identity, identifier = NewEapID} ->
  -					NextEapID = (NewEapID rem 255) + 1,
  -					EapPacket = #eap_packet{code = request, type = ?PWD,
  -							identifier = NextEapID, data = EapData},
  -					NewStateData = StateData#statedata{eap_id = NextEapID},
  -					Answer = generate_diameter_response(SessionId, AuthType,
  -							?'DIAMETER_BASE_RESULT-CODE_MULTI_ROUND_AUTH', OHost, ORealm,
  -							EapPacket),
  -					{reply, Answer, id, NewStateData, ?TIMEOUT};
  -				#eap_packet{code = request, identifier = NewEapID} ->
  -					EapPacket = #eap_packet{code = response, type = ?LegacyNak,
  -							identifier = NewEapID, data = <<0>>},
  -					Answer = generate_diameter_response(SessionId, AuthType,
  -							?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OHost, ORealm,
  -							EapPacket),
  -					{stop, {shutdown, SessionId}, Answer, StateData};
  -				#eap_packet{code = Code, type = EapType,
  -						identifier = NewEapID, data = Data} ->
  -					error_logger:warning_report(["Unknown EAP received",
  -							{pid, self()}, {session_id, SessionId}, {code, Code},
  -							{type, EapType}, {identifier, NewEapID}, {data, Data}]),
  -					EapPacket = #eap_packet{code = failure, identifier = NewEapID},
  -					Answer = generate_diameter_response(SessionId, AuthType,
  -							?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OHost, ORealm,
  -							EapPacket),
  -					{stop, {shutdown, SessionId}, Answer, StateData};
  -				{'EXIT', _Reason} ->
  -					EapPacket = #eap_packet{code = failure, identifier = EapID},
  -					Answer = generate_diameter_response(SessionId, AuthType,
  -							?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OHost, ORealm,
  -							EapPacket),
  -					{stop, {shutdown, SessionId}, Answer, StateData}
  -			end
  -	end.
  -
   -spec id(Event, StateData) -> Result
   	when
   		Event :: timeout | term(),
  
positive.code: 					auth_app_id = ApplicationId, auth_req_type = AuthType, origin_host = OHost,
  					origin_realm = ORealm, diameter_port_server = PortServer, start = Request},
  			process_flag(trap_exit, true),
  			{ok, eap_start, StateData}
  		end.
  
  -spec eap_start(Event, StateData) -> Result
  
negative.code: 			EapPacket = #eap_packet{code = failure, identifier = EapID},
  			Answer = generate_diameter_response(SessionID, AuthType,
  					 ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OH, OR, EapPacket),
  			gen_server:cast(PortServer, {self(), Answer}),
  			{stop, {shutdown, SessionID}, StateData}
  	end.
  %% @hidden
  confirm5(#statedata{eap_id = EapID, ks = Ks, confirm_p = ConfirmP,
  		scalar_s = ScalarS, element_s = ElementS, scalar_p = ScalarP,
  		element_p = ElementP, group_desc = GroupDesc, rand_func = RandFunc,
  		prf = PRF, session_id = SessionID, auth_req_type = AuthType,
  		origin_host = OH, origin_realm = OR, diameter_port_server = PortServer} = StateData) ->
  	Ciphersuite = <<GroupDesc:16, RandFunc, PRF>>,
  	case ocs_eap_pwd:h([Ks, ElementP, ScalarP,
  			ElementS, ScalarS, Ciphersuite]) of
  