anchor.diff:  %% RFC 5246 Section 7.4.1.2
   %% ClientHelloMessage - <<ProtocolVersion:16, Gmt_unix_time:32, ClientRand:28,
   %%		SessionID, CipherSuite, CompressionMethod, ..>>
  -client_hello1(<<?Handshake, _:32, ?ClientHello, _:72
  +client_hello1(<<?Handshake, _:32, ?ClientHello, _:72,
   		ClientRand:28/binary, _/binary>>, StateData) ->
   	StateData#statedata{client_rand = ClientRand}.
   
  
positive.code: server_passthrough(timeout, #statedata{session_id = SessionID} =
  		StateData) ->
  	{stop, {shutdown, SessionID}, StateData};
  server_passthrough(accept, #statedata{eap_id = EapID, 
  		session_id = SessionID, secret = Secret,
  		req_auth = RequestAuthenticator, radius_fsm = RadiusFsm,
  		radius_id = RadiusID} = StateData) ->
  	EapPacket = #eap_packet{code = success, identifier = EapID},
  	send_response(EapPacket, ?AccessAccept,
  		RadiusID, [], RequestAuthenticator, Secret, RadiusFsm),
  	{stop, {shutdown, SessionID}, StateData};
  server_passthrough(reject, #statedata{eap_id = EapID, 
  		session_id = SessionID, secret = Secret,
  
negative.code: 	ResponsePacket = radius:codec(Response),
  	radius:response(RadiusFsm, {response, ResponsePacket}).
  
  -spec encrypt_key(Secret :: binary(), RequestAuthenticator :: [byte()],
  		Salt :: integer(), Key :: binary()) ->
  	Ciphertext :: binary().
  %% @doc Encrypt the Pairwise Master Key (PMK) according to RFC2548
  %% 	section 2.4.2 for use as String in a MS-MPPE-Send-Key attribute.
  %% @private
  encrypt_key(Secret, RequestAuthenticator, Salt, Key) when (Salt bsr 15) == 1 ->
  	KeyLength = size(Key),
  	Plaintext = case (KeyLength + 1) rem 16 of
  		0 ->
  			<<KeyLength, Key/binary>>;
  		N ->
  			PadLength = (16 - N) * 8,
  			<<KeyLength, Key/binary, 0:PadLength>>
  	end,
  	F = fun(P, [H | _] = Acc) ->
  				B = crypto:hash(md5, [Secret, H]),
  				C = crypto:exor(P, B),
  				[C | Acc]
  	end,
  	AccIn = [[RequestAuthenticator, <<Salt:16>>]],
  	AccOut = lists:foldl(F, AccIn, [P || <<P:16/binary>> <= Plaintext]),
  	iolist_to_binary(tl(lists:reverse(AccOut))).
  
  