Document

TS001-1.0.4 LoRaWAN® L2 1.0.4 Specification

Issue link: https://read.uberflip.com/i/1428395

Contents of this Issue

Navigation

Page 24 of 89

LoRaWAN ® L2 1.0.4 Specification © 2020 LoRa Alliance ® Page 25 of 90 The authors reserve the right to change specifications without notice. The direction field (Dir) is 0 for uplink frames and 1 for downlink frames. 785 The blocks A i SHALL be encrypted to obtain a sequence S of blocks S i as follows: 786 787 S i = aes128_encrypt(K, A i ) for i = 1..k 788 S = S 1 | S 2 | .. | S k . 789 790 Encryption and decryption of the payload SHALL be calculated as follows: 791 792 FRMPayloadPad = (pld | pad 16 ) xor S 793 FRMPayload = FRMPayloadPad[0..len(pld)-1] . 794 4.4 Message Integrity Code (MIC) 795 The message integrity code (MIC) is calculated over all the fields in the frame. 796 797 msg = MHDR | FHDR | FPort | FRMPayload , 798 where len(msg) denotes the length of the frame in octets. 799 800 The MIC SHALL be calculated as follows [RFC4493]: 801 802 CMAC = aes128_cmac(NwkSKey, B 0 | msg) 803 MIC = CMAC[0..3] , 804 805 where block B 0 is defined as follows: 806 807 808 Size (octets) 1 4 1 4 4 1 1 B 0 0x49 4 × 0x00 Dir DevAddr FCntUp or FCntDown 0x00 len(msg) Table 13: B 0 format 809 810 811 The direction field (Dir) is 0 for uplink frames and 1 for downlink frames. 812

Articles in this issue

view archives of Document - TS001-1.0.4 LoRaWAN® L2 1.0.4 Specification