anchor.diff:  append_attr(Attr, State) ->
       State#decoder_state{attrs = [Attr | State#decoder_state.attrs]}.
   
  --spec decode_attributes(#radius_request{}, binary()) -> #decoder_state{}.
  -decode_attributes(Req, As) ->
  -    decode_attributes(Req, As, 0, #decoder_state{}).
  +-spec decode_attributes(#radius_request{}, binary(), binary()) -> #decoder_state{}.
  +decode_attributes(Req, RequestAuthenticator, As) ->
  +    decode_attributes(Req, As, 0, #decoder_state{request_authenticator = RequestAuthenticator}).
   
   -spec decode_attributes(#radius_request{}, binary(), non_neg_integer(), #decoder_state{}) -> #decoder_state{}.
   decode_attributes(_Req, <<>>, _Pos, State) ->
  
positive.code: 
  -spec salt_encrypt(salt(), secret(), authenticator(), binary()) -> binary().
  salt_encrypt(Salt, SharedSecret, RequestAuthenticator, PlainText) ->
      CipherText = do_salt_crypt(Salt, SharedSecret, RequestAuthenticator, (pad_to(16, << (byte_size(PlainText)):8, PlainText/binary >>))),
      <<Salt/binary, CipherText/binary>>.
  
  -spec salt_decrypt(secret(), authenticator(), binary()) -> binary().
  salt_decrypt(SharedSecret, RequestAuthenticator, <<Salt:2/binary, CipherText/binary>>) ->
      << Length:8/integer, PlainText/binary >> = do_salt_crypt(Salt, SharedSecret, RequestAuthenticator, CipherText),
      if
          Length < byte_size(PlainText) ->
              binary:part(PlainText, 0, Length);
  
negative.code:             PlainText
      end.
  
  do_salt_crypt(Op, Salt, SharedSecret, RequestAuthenticator, <<CipherText/binary>>) ->
      B = crypto:hash(md5, [SharedSecret, RequestAuthenticator, Salt]),
      salt_crypt(Op, SharedSecret, B, CipherText, << >>).
  
  salt_crypt(Op, SharedSecret, B, <<PlainText:16/binary, Remaining/binary>>, CipherText) ->
      NewCipherText = crypto:exor(PlainText, B),
      Bnext = case Op of
  		decrypt -> crypto:hash(md5, [SharedSecret, PlainText]);
  		encrypt -> crypto:hash(md5, [SharedSecret, NewCipherText])
  	    end,
      salt_crypt(Op, SharedSecret, Bnext, Remaining, <<CipherText/binary, NewCipherText/binary>>);
  
  salt_crypt(Op, _SharedSecret, _B, << >>, CipherText) ->
      CipherText.
  
  %% @doc pad binary to specific length
  