code: function verifyAndDecrypt(cipherText, mac, AAD, nonce, key) {
      const matches =
          Sodium.crypto_verify_16(
              mac,
              computePoly1305(cipherText, AAD, nonce, key)
          );
  
      if (matches === 0) {
          return Sodium
              .crypto_stream_chacha20_xor_ic(cipherText, nonce, 1, key);
      }
  
      return null;
  }
docs: i'd really prefer for this to be a direct call to Sodium.crypto_aead_chacha20poly1305_decrypt() but unfortunately the way it constructs the message to calculate the HMAC is not compatible with homekit (long story short, it uses [ AAD, AAD.length, CipherText, CipherText.length ] whereas homekit expects [ AAD, CipherText, AAD.length, CipherText.length ]