4.4 Message Integrity Code (MIC)
- The message integrity code (MIC) is calculated over all the fields in the message.
- msg =MHDR|FHDR|FPort|FRMPayload
- whereby len(msg) denotes the length of the message in octets.
- The MIC is calculated as follows [RFC4493]:
29
- cmac = aes128cmac(NwkSKey, _B0 | msg)
- MIC =cmac[0..3]
32 | ||||||||
---|---|---|---|---|---|---|---|---|
33 | whereby the block B0 is defined as follows: | |||||||
Size (bytes) | 1 | 4 | 1 | 4 | 4 | 1 | 1 | |
B0 | 0x49 | 4 x 0x00 | Dir | DevAddr | FCntUp or | 0x00 | len(msg) | |
FCntDown | ||||||||
©2016 LoRa™ Alliance Page 20 of 70
The authors reserve the right to change specifications without notice.
LoRaWAN Specification
1
2 The direction field (Dir) is 0 for uplink frames and 1 for downlink frames.
©2016 LoRa™ Alliance Page 21 of 70
The authors reserve the right to change specifications without notice.
LoRaWAN Specification