anchor.diff:      #key_pair{public = PubKeyA} = KeyPair = get_new_key_pair(),
       case
           gen_tcp:send(
  -          Socket, encrypt_chunk(Params, Seq, [?REKEY_CHUNK, PubKeyA]))
  +          Socket,
  +          encrypt_chunk(
  +            Params, Seq, [?REKEY_CHUNK, PubKeyA], byte_size(PubKeyA)))
       of
           ok ->
               SharedSecret = compute_shared_secret(KeyPair, PubKeyB),
  
positive.code:         {?MODULE, From, {send, Data}} ->
              {SendParams_1, SendSeq_1, Result} =
                  encrypt_and_send_chunk(
                    SendParams, SendSeq, [?HANDSHAKE_CHUNK, Data]),
              if
                  Result =:= ok ->
                      reply(From, ok),
  
negative.code: encrypt_chunk(
    #params{
       aead_cipher = AeadCipher,
       iv = {IVSalt, IVNo}, key = Key, tag_len = TagLen},
    Seq, Cleartext, Size) ->
      %%
      ChunkLen = Size + TagLen,
      AAD = <<Seq:32, ChunkLen:32>>,
      IVBin = <<IVSalt/binary, (IVNo + Seq):48>>,
      {Ciphertext, CipherTag} =
  