code: function encryptAndSeal(plainText, AAD, nonce, key) {
      const cipherText =
          Sodium
              .crypto_stream_chacha20_xor_ic(plainText, nonce, 1, key);
  
      const hmac =
          computePoly1305(cipherText, AAD, nonce, key);
  
      return [ cipherText, hmac ];
  }
docs: See above about calling directly into libsodium.