DecryptDownlink decrypts a downlink payload - The payload contains the FRMPayload bytes - For FPort>0, the AppSKey is used - For FPort=0, the NwkSEncKey/NwkSKey is used
(key types.AES128Key, addr types.DevAddr, fCnt uint32, payload []byte, opts ...EncryptionOption)
| 112 | // - For FPort>0, the AppSKey is used |
| 113 | // - For FPort=0, the NwkSEncKey/NwkSKey is used |
| 114 | func DecryptDownlink(key types.AES128Key, addr types.DevAddr, fCnt uint32, payload []byte, opts ...EncryptionOption) ([]byte, error) { |
| 115 | return encryptMessage(key, 1, addr, fCnt, payload, opts...) |
| 116 | } |
| 117 | |
| 118 | func computeMIC(key types.AES128Key, dir uint8, confFCnt uint16, addr types.DevAddr, fCnt uint32, payload []byte) ([4]byte, error) { |
| 119 | hash, _ := cmac.New(key[:]) |