anchor.diff:                      output_handler_data(Params, Seq);
                   dist_tick ->
                       output_handler_tick(Params, Seq);
  -                Other ->
  +                _ when Msg =:= Params#params.rekey_msg ->
  +                    Params_1 = output_handler_rekey(Params, Seq),
  +                    output_handler(Params_1, 0);
  +                _ ->
                       %% Ignore
  -                    _ = trace(Other),
  +                    _ = trace(Msg),
                       output_handler(Params, Seq)
               end
       end.
  
positive.code:                 hmac_key_iv(
                    HmacAlgo, SharedSecret, [Key, IVSalt, IV],
                    KeyLen, IVSaltLen + 6),
              Params_1 = Params#params{key = Key_1, iv = {IVSalt_1, IVNo_1}},
              Result =
                  gen_tcp:send(Socket, encrypt_chunk(Params_1, 0, Cleartext)),
              {Params_1, 1, Result};
          SendError ->
              {Params, Seq + 1, SendError}
      end;
  encrypt_and_send_chunk(#params{socket = Socket} = Params, Seq, Cleartext) ->
      Result = gen_tcp:send(Socket, encrypt_chunk(Params, Seq, Cleartext)),
      {Params, Seq + 1, Result}.
  
  encrypt_chunk(
    #params{
       aead_cipher = AeadCipher,
  
negative.code: 
  encrypt_and_send_chunk(
    #params{
       socket = Socket, rekey_count = Seq, rekey_msg = RekeyMsg} = Params,
    Seq, Cleartext) ->
      %%
      cancel_rekey_timer(RekeyMsg),
      case encrypt_and_send_rekey_chunk(Params, Seq) of
          #params{} = Params_1 ->
              Result =
                  gen_tcp:send(Socket, encrypt_chunk(Params, 0, Cleartext)),
              {Params_1, 1, Result};
          SendError ->
              {Params, Seq + 1, SendError}
      end;
  encrypt_and_send_chunk(#params{socket = Socket} = Params, Seq, Cleartext) ->
      Result = gen_tcp:send(Socket, encrypt_chunk(Params, Seq, Cleartext)),
      {Params, Seq + 1, Result}.
  
  encrypt_and_send_rekey_chunk(
    #params{
       socket = Socket,
       rekey_key = PubKeyB,
       key = Key,
       iv = {IVSalt, IVNo},
       hmac_algorithm = HmacAlgo} = Params,
    Seq) ->
      %%
      KeyLen = byte_size(Key),
      IVSaltLen = byte_size(IVSalt),
  