anchor.diff:  		Body = ocs_eap_codec:eap_pwd_commit(BodyData),
   		#eap_pwd_commit{element = ElementP, scalar = ScalarP} = Body,
   		ExpectedSize = size(<<ElementS/binary, ScalarS/binary>>),
  -		case size(BodyData) of
  +		case size(BodyData) of 
   			ExpectedSize ->
  -				case {ElementP, ScalarP} of
  -					{ElementS, ScalarS} ->
  -						send_reject(RadiusID, RequestAuthenticator, Secret, RadiusFsm),
  -						{next_state, wait_for_commit, StateData, 0};
  -					_ ->
  -					case ScalarP of
  -						ValidScalarP when  1 =< ScalarP,
  -								ScalarP >= 16#ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551->
  -							NewEAPID = EapID + 1,
  -							Packet = #eap_packet{code = ?Request, identifier = NewEAPID, data = Data},
  -							EAPPacketData = ocs_eap_codec:eap_packet(Packet),
  -							AttributeList0 = radius_attributes:new(),
  -							AttributeList1 = radius_attributes:store(?EAPMessage,
  -									EAPPacketData, AttributeList0),
  -							AttributeList2 = radius_attributes:store(?MessageAuthenticator,
  -									<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>, AttributeList1),
  -							AttrList2bin = radius_attributes:codec(AttributeList2),
  -							Response1 = #radius{code = ?AccessChallenge, id = RadiusID,
  -							authenticator = RequestAuthenticator, attributes = AttrList2bin},
  -							ResponsePacket1 = radius:codec(Response1),
  -							MessageAuthenticator = crypto:hmac(md5, Secret, ResponsePacket1),
  -							AttributeList3 = radius_attributes:store(?MessageAuthenticator,
  -									MessageAuthenticator, AttributeList1),
  -							AttributeData = radius_attributes:codec(AttributeList3),
  -							Length = size(AttributeData) + 20,
  -							ResponseAuthenticator = crypto:hash(md5,[<<?AccessChallenge, RadiusID,
  -									Length:16>>, RequestAuthenticator, AttributeData, Secret]),
  -							Response = #radius{code = ?AccessChallenge, id = RadiusID,
  -									authenticator = ResponseAuthenticator, attributes = AttributeData},
  -							ResponsePacket = radius:codec(Response),
  -							radius:response(RadiusFsm, ResponsePacket),
  -							NewStateData = StateData#statedata{scalar_p = ScalarP, element_p = ElementP,
  -									eap_id = NewEAPID},
  -							{next_state, wait_for_confirm, StateData, ?TIMEOUT};
  -						_ScalarP_Out_of_Range ->
  -							send_reject(RadiusID, RequestAuthenticator, Secret, RadiusFsm),
  -							{next_state, wait_for_commit, StateData, 0}
  -					end
  -				end;
  +				NewStateData = StateData#statedata{scalar_p = ScalarP, element_p = ElementP},
  +				wait_for_commit1(NewStateData);
   			_ ->
   				send_reject(RadiusID, RequestAuthenticator, Secret, RadiusFsm),
   				{next_state, wait_for_commit, StateData, 0}
  
positive.code: %%
  wait_for_commit(timeout, #statedata{session_id = SessionID} = StateData)->
  	{stop, {shutdown, SessionID}, StateData};
  wait_for_commit({eap_response, EAPPacket}, #statedata{eap_id = EapID, element_s = ElementS,
  		scalar_s = ScalarS, radius_fsm = RadiusFsm, radius_id = RadiusID,
  		secret = Secret, authenticator = RequestAuthenticator} = StateData)->
  	try 
  		EAPData = ocs_eap_codec:eap_packet(EAPPacket),
  
negative.code: 		_:_ ->
  			{next_state, wait_for_commit, StateData,0}
  	end.
  %% @hidden
  wait_for_commit1(#statedata{element_p = ElementP, scalar_p = ScalarP, scalar_s = ScalarS,
  		element_s = ElementS,  radius_fsm = RadiusFsm, radius_id = RadiusID,
  		secret = Secret, authenticator = RequestAuthenticator} = StateData) ->
  	case {ElementP, ScalarP} of
  		{ElementS, ScalarS} ->
  			send_reject(RadiusID, RequestAuthenticator, Secret, RadiusFsm),
  			{next_state, wait_for_commit, StateData, 0};
  		_ ->
  			wait_for_commit2(StateData)
  	end.
  %% @hidden
  wait_for_commit2(#statedata{scalar_p = ScalarP, radius_fsm = RadiusFsm, radius_id = RadiusID,
  		secret = Secret, authenticator = RequestAuthenticator} = StateData)->
  	case ScalarP of
  		_ValidScalarP when  1 =< ScalarP, ScalarP >= $R ->
  			wait_for_commit3(StateData);
  		_ScalarP_Out_of_Range ->
  			send_reject(RadiusID, RequestAuthenticator, Secret, RadiusFsm),
  			{next_state, wait_for_commit, StateData, 0}
  	end.
  %% @hidden
  wait_for_commit3(StateData)->
  				{next_state, wait_for_confirm, StateData, ?TIMEOUT}.
  
  -spec wait_for_confirm(Event :: timeout | term(), StateData :: #statedata{}) ->
  	Result :: {next_state, NextStateName :: atom(), NewStateData :: #statedata{}}
  