title: Python - cannot decrypt some Zigbee packet
body: <p>I am trying to use pycryptodome to decrypt some Zigbee packet.
  My code is something like this:</p>
  <pre><code> nonce = pack('&lt;QIB', ext_src, sec_fc, sec_cntl)
   ...
   cipher = AES.new(key=k, mode=AES.MODE_CCM, nonce=nonce, mac_len=4)
   cipher.update(a)
   decrypted_data = cipher.decrypt_and_verify(pkt.data, tag)
  </code></pre>
  <p>The above code works well with most Zigbee packets I tested, but cannot work with some packets. Not only verify fails, but also plaintext is wrong.</p>
  <p>I have attached one packet as below:</p>
  <pre><code>618863ec5ff9d9ffb30800f9d9ffb301e7218b3003a003003512a200018817009c44364fe48cb58afaba20f4395a3fa8460e6ce80801e04036cee3cf9ff90c7503b67e3c0ee67a
  </code></pre>
  <p>And Wireshark can decrypt well:
  <a href="https://i.stack.imgur.com/ApIKB.png" rel="nofollow noreferrer">Wireshark</a></p>
  <p>The output from my codes are:</p>
  <pre><code>key: 5a6967426565416c6c69616e63653039
  nwk_hdr: 0800f9d9ffb301e7
  aux_hdr: 3503a003003512a20001881700
  nonce: 3512a2000188170003a0030035
  tag: 3c0ee67a
  </code></pre>
  <p>Appreciated if anyone knows where it is wrong from the code. Thanks.</p>