anchor.diff:  encrypt_chunk(
     #params{
        block_crypto = BlockCrypto,
  -     iv = IV, key = Key, tag_len = TagLen}, Seq, Cleartext) ->
  +     iv = {IVSalt, IVNo}, key = Key, tag_len = TagLen}, Seq, Cleartext) ->
       %%
       ChunkLen = iolist_size(Cleartext) + TagLen,
       AAD = <<Seq:32, ChunkLen:32>>,
  +    IVBin = <<IVSalt/binary, (IVNo + Seq):48>>,
       {Ciphertext, CipherTag} =
  -        crypto:block_encrypt(BlockCrypto, Key, IV, {AAD, Cleartext, TagLen}),
  +        crypto:block_encrypt(BlockCrypto, Key, IVBin, {AAD, Cleartext, TagLen}),
       Chunk = [Ciphertext,CipherTag],
       Chunk.
   
   decrypt_chunk(
     #params{
        block_crypto = BlockCrypto,
  -     iv = IV, key = Key, tag_len = TagLen} = Params, Seq, Chunk) ->
  +     iv = {IVSalt, IVNo}, key = Key, tag_len = TagLen} = Params, Seq, Chunk) ->
       %%
       ChunkLen = byte_size(Chunk),
       if
  
positive.code: encrypt_and_send_chunk(
    #params{
       socket = Socket, rekey_interval = Seq,
       key = Key, iv = IV, hash_algorithm = HashAlgorithm} = Params,
    Seq, Cleartext) ->
      %%
      KeyLen = byte_size(Key),
      IVLen = byte_size(IV),
      Chunk = <<IV_1:IVLen/binary, KeySalt:KeyLen/binary>> =
          crypto:strong_rand_bytes(IVLen + KeyLen),
      case
          gen_tcp:send(
            Socket, encrypt_chunk(Params, Seq, [?REKEY_CHUNK, Chunk]))
      of
          ok ->
              Key_1 = hash_key(HashAlgorithm, Key, KeySalt),
              Params_1 = Params#params{key = Key_1, iv = IV_1},
              Result =
                  gen_tcp:send(Socket, encrypt_chunk(Params_1, 0, Cleartext)),
              {Params_1, 1, Result};
  
negative.code: 	  (byte_size(HashAlgorithmBin)), HashAlgorithmBin/binary,
  	  (byte_size(BlockCryptoBin)), BlockCryptoBin/binary,
  	  KeyLen, TagLen>>,
      <<KeySalt:KeyLen/binary, OtherSalt:KeyLen/binary,
        IVSalt:IVSaltLen/binary, IVNo:48>> =
          Data = crypto:strong_rand_bytes(KeyLen + KeyLen + IVSaltLen + 6),
      {#params{
          socket = Socket,
          protocol = Protocol,
          hash_algorithm = HashAlgorithm,
          block_crypto = BlockCrypto,
          iv = {IVSalt, IVNo},
          key = {KeySalt, OtherSalt},
          tag_len = TagLen,
          rekey_interval = RekeyInterval}, Header, Data}.
  