ARM GAS /tmp/ccDkMnY2.s page 1 1 .cpu cortex-m0plus 2 .eabi_attribute 20, 1 3 .eabi_attribute 21, 1 4 .eabi_attribute 23, 3 5 .eabi_attribute 24, 1 6 .eabi_attribute 25, 1 7 .eabi_attribute 26, 1 8 .eabi_attribute 30, 1 9 .eabi_attribute 34, 0 10 .eabi_attribute 18, 4 11 .file "LoRaMacCrypto.c" 12 .text 13 .Ltext0: 14 .cfi_sections .debug_frame 15 .section .text.LoRaMacComputeMic,"ax",%progbits 16 .align 1 17 .global LoRaMacComputeMic 18 .syntax unified 19 .code 16 20 .thumb_func 21 .fpu softvfp 23 LoRaMacComputeMic: 24 .LFB82: 25 .file 1 "./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c" 1:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** /* 2:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** / _____) _ | | 3:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** ( (____ _____ ____ _| |_ _____ ____| |__ 4:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** \____ \| ___ | (_ _) ___ |/ ___) _ \ 5:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** _____) ) ____| | | || |_| ____( (___| | | | 6:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** (______/|_____)_|_|_| \__)_____)\____)_| |_| 7:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** (C)2013 Semtech 8:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** ___ _____ _ ___ _ _____ ___ ___ ___ ___ 9:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 10:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 11:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 12:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** embedded.connectivity.solutions=============== 13:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 14:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** Description: LoRa MAC layer implementation 15:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 16:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** License: Revised BSD License, see LICENSE.TXT file include in the project 17:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 18:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** Maintainer: Miguel Luis ( Semtech ), Gregory Cristian ( Semtech ) and Daniel Jaeckle ( STACKFORCE ) 19:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** */ 20:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** #include 21:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** #include 22:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** #include "utilities.h" 23:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 24:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** #include "aes.h" 25:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** #include "cmac.h" 26:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 27:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** #include "LoRaMacCrypto.h" 28:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 29:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** /*! 30:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * CMAC/AES Message Integrity Code (MIC) Block B0 size 31:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** */ 32:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** #define LORAMAC_MIC_BLOCK_B0_SIZE 16 33:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** ARM GAS /tmp/ccDkMnY2.s page 2 34:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** /*! 35:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * MIC field computation initial data 36:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** */ 37:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** static uint8_t MicBlockB0[] = { 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 39:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** }; 40:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 41:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** /*! 42:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * Contains the computed MIC field. 43:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * 44:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * \remark Only the 4 first bytes are used 45:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** */ 46:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** static uint8_t Mic[16]; 47:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 48:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** /*! 49:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * Encryption aBlock and sBlock 50:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** */ 51:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** static uint8_t aBlock[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 53:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** }; 54:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** static uint8_t sBlock[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 56:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** }; 57:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 58:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** /*! 59:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * AES computation context variable 60:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** */ 61:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** static aes_context AesContext; 62:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 63:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** /*! 64:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * CMAC computation context variable 65:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** */ 66:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** static AES_CMAC_CTX AesCmacCtx[1]; 67:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 68:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** /*! 69:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * \brief Computes the LoRaMAC frame MIC field 70:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * 71:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * \param [IN] buffer Data buffer 72:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * \param [IN] size Data buffer size 73:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * \param [IN] key AES key to be used 74:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * \param [IN] address Frame address 75:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * \param [IN] dir Frame direction [0: uplink, 1: downlink] 76:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * \param [IN] sequenceCounter Frame sequence counter 77:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** * \param [OUT] mic Computed MIC field 78:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** */ 79:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** void LoRaMacComputeMic( const uint8_t *buffer, uint16_t size, const uint8_t *key, uint32_t address, 80:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 26 .loc 1 80 0 27 .cfi_startproc 28 @ args = 12, pretend = 0, frame = 8 29 @ frame_needed = 0, uses_anonymous_args = 0 30 .LVL0: 31 0000 F0B5 push {r4, r5, r6, r7, lr} 32 .LCFI0: 33 .cfi_def_cfa_offset 20 34 .cfi_offset 4, -20 35 .cfi_offset 5, -16 ARM GAS /tmp/ccDkMnY2.s page 3 36 .cfi_offset 6, -12 37 .cfi_offset 7, -8 38 .cfi_offset 14, -4 39 0002 83B0 sub sp, sp, #12 40 .LCFI1: 41 .cfi_def_cfa_offset 32 42 0004 0190 str r0, [sp, #4] 43 0006 0D00 movs r5, r1 44 0008 1600 movs r6, r2 45 000a 08AA add r2, sp, #32 46 .LVL1: 47 000c 1278 ldrb r2, [r2] 48 .LVL2: 49 000e 0999 ldr r1, [sp, #36] 50 .LVL3: 81:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** MicBlockB0[5] = dir; 51 .loc 1 81 0 52 0010 1B4C ldr r4, .L2 53 0012 6271 strb r2, [r4, #5] 82:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 83:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** MicBlockB0[6] = ( address ) & 0xFF; 54 .loc 1 83 0 55 0014 A371 strb r3, [r4, #6] 84:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** MicBlockB0[7] = ( address >> 8 ) & 0xFF; 56 .loc 1 84 0 57 0016 1A0A lsrs r2, r3, #8 58 0018 E271 strb r2, [r4, #7] 85:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** MicBlockB0[8] = ( address >> 16 ) & 0xFF; 59 .loc 1 85 0 60 001a 1A0C lsrs r2, r3, #16 61 001c 2272 strb r2, [r4, #8] 86:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** MicBlockB0[9] = ( address >> 24 ) & 0xFF; 62 .loc 1 86 0 63 001e 1B0E lsrs r3, r3, #24 64 .LVL4: 65 0020 6372 strb r3, [r4, #9] 87:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 88:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** MicBlockB0[10] = ( sequenceCounter ) & 0xFF; 66 .loc 1 88 0 67 0022 A172 strb r1, [r4, #10] 89:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** MicBlockB0[11] = ( sequenceCounter >> 8 ) & 0xFF; 68 .loc 1 89 0 69 0024 0B0A lsrs r3, r1, #8 70 0026 E372 strb r3, [r4, #11] 90:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** MicBlockB0[12] = ( sequenceCounter >> 16 ) & 0xFF; 71 .loc 1 90 0 72 0028 0B0C lsrs r3, r1, #16 73 002a 2373 strb r3, [r4, #12] 91:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** MicBlockB0[13] = ( sequenceCounter >> 24 ) & 0xFF; 74 .loc 1 91 0 75 002c 090E lsrs r1, r1, #24 76 002e 6173 strb r1, [r4, #13] 92:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 93:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** MicBlockB0[15] = size & 0xFF; 77 .loc 1 93 0 78 0030 E573 strb r5, [r4, #15] 94:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** ARM GAS /tmp/ccDkMnY2.s page 4 95:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** AES_CMAC_Init( AesCmacCtx ); 79 .loc 1 95 0 80 0032 144F ldr r7, .L2+4 81 0034 3800 movs r0, r7 82 .LVL5: 83 0036 FFF7FEFF bl AES_CMAC_Init 84 .LVL6: 96:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 97:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** AES_CMAC_SetKey( AesCmacCtx, key ); 85 .loc 1 97 0 86 003a 3100 movs r1, r6 87 003c 3800 movs r0, r7 88 003e FFF7FEFF bl AES_CMAC_SetKey 89 .LVL7: 98:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 99:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** AES_CMAC_Update( AesCmacCtx, MicBlockB0, LORAMAC_MIC_BLOCK_B0_SIZE ); 90 .loc 1 99 0 91 0042 1022 movs r2, #16 92 0044 2100 movs r1, r4 93 0046 3800 movs r0, r7 94 0048 FFF7FEFF bl AES_CMAC_Update 95 .LVL8: 100:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 101:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** AES_CMAC_Update( AesCmacCtx, buffer, size & 0xFF ); 96 .loc 1 101 0 97 004c FF22 movs r2, #255 98 004e 2A40 ands r2, r5 99 0050 0199 ldr r1, [sp, #4] 100 0052 3800 movs r0, r7 101 0054 FFF7FEFF bl AES_CMAC_Update 102 .LVL9: 102:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 103:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** AES_CMAC_Final( Mic, AesCmacCtx ); 103 .loc 1 103 0 104 0058 0B4C ldr r4, .L2+8 105 005a 3900 movs r1, r7 106 005c 2000 movs r0, r4 107 005e FFF7FEFF bl AES_CMAC_Final 108 .LVL10: 104:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 105:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** *mic = ( uint32_t )( ( uint32_t )Mic[3] << 24 | ( uint32_t )Mic[2] << 16 | ( uint32_t )Mic[1] < 109 .loc 1 105 0 110 0062 E378 ldrb r3, [r4, #3] 111 0064 1B06 lsls r3, r3, #24 112 0066 A278 ldrb r2, [r4, #2] 113 0068 1204 lsls r2, r2, #16 114 006a 1343 orrs r3, r2 115 006c 6278 ldrb r2, [r4, #1] 116 006e 1202 lsls r2, r2, #8 117 0070 1343 orrs r3, r2 118 0072 2278 ldrb r2, [r4] 119 0074 1343 orrs r3, r2 120 0076 0A9A ldr r2, [sp, #40] 121 0078 1360 str r3, [r2] 106:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 122 .loc 1 106 0 123 007a 03B0 add sp, sp, #12 ARM GAS /tmp/ccDkMnY2.s page 5 124 @ sp needed 125 .LVL11: 126 007c F0BD pop {r4, r5, r6, r7, pc} 127 .L3: 128 007e C046 .align 2 129 .L2: 130 0080 00000000 .word .LANCHOR0 131 0084 00000000 .word AesCmacCtx 132 0088 00000000 .word .LANCHOR1 133 .cfi_endproc 134 .LFE82: 136 .section .text.LoRaMacPayloadEncrypt,"ax",%progbits 137 .align 1 138 .global LoRaMacPayloadEncrypt 139 .syntax unified 140 .code 16 141 .thumb_func 142 .fpu softvfp 144 LoRaMacPayloadEncrypt: 145 .LFB83: 107:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 108:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** void LoRaMacPayloadEncrypt( const uint8_t *buffer, uint16_t size, const uint8_t *key, uint32_t addr 109:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 146 .loc 1 109 0 147 .cfi_startproc 148 @ args = 12, pretend = 0, frame = 8 149 @ frame_needed = 0, uses_anonymous_args = 0 150 .LVL12: 151 0000 F0B5 push {r4, r5, r6, r7, lr} 152 .LCFI2: 153 .cfi_def_cfa_offset 20 154 .cfi_offset 4, -20 155 .cfi_offset 5, -16 156 .cfi_offset 6, -12 157 .cfi_offset 7, -8 158 .cfi_offset 14, -4 159 0002 DE46 mov lr, fp 160 0004 4746 mov r7, r8 161 0006 80B5 push {r7, lr} 162 .LCFI3: 163 .cfi_def_cfa_offset 28 164 .cfi_offset 8, -28 165 .cfi_offset 11, -24 166 0008 83B0 sub sp, sp, #12 167 .LCFI4: 168 .cfi_def_cfa_offset 40 169 000a 0400 movs r4, r0 170 000c 8846 mov r8, r1 171 000e 0192 str r2, [sp, #4] 172 0010 1E00 movs r6, r3 173 0012 0AAB add r3, sp, #40 174 .LVL13: 175 0014 1B78 ldrb r3, [r3] 176 .LVL14: 177 0016 9B46 mov fp, r3 178 0018 0B9D ldr r5, [sp, #44] 179 001a 0C9F ldr r7, [sp, #48] ARM GAS /tmp/ccDkMnY2.s page 6 180 .LVL15: 110:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** uint16_t i; 111:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** uint8_t bufferIndex = 0; 112:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** uint16_t ctr = 1; 113:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 114:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** memset1( AesContext.ksch, '\0', 240 ); 181 .loc 1 114 0 182 001c F022 movs r2, #240 183 .LVL16: 184 001e 0021 movs r1, #0 185 .LVL17: 186 0020 2948 ldr r0, .L14 187 .LVL18: 188 0022 FFF7FEFF bl memset1 189 .LVL19: 115:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_set_key( key, 16, &AesContext ); 190 .loc 1 115 0 191 0026 284A ldr r2, .L14 192 0028 1021 movs r1, #16 193 002a 0198 ldr r0, [sp, #4] 194 002c FFF7FEFF bl aes_set_key 195 .LVL20: 116:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 117:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[5] = dir; 196 .loc 1 117 0 197 0030 264B ldr r3, .L14+4 198 0032 5A46 mov r2, fp 199 0034 5A71 strb r2, [r3, #5] 118:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 119:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[6] = ( address ) & 0xFF; 200 .loc 1 119 0 201 0036 9E71 strb r6, [r3, #6] 120:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[7] = ( address >> 8 ) & 0xFF; 202 .loc 1 120 0 203 0038 320A lsrs r2, r6, #8 204 003a DA71 strb r2, [r3, #7] 121:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[8] = ( address >> 16 ) & 0xFF; 205 .loc 1 121 0 206 003c 320C lsrs r2, r6, #16 207 003e 1A72 strb r2, [r3, #8] 122:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[9] = ( address >> 24 ) & 0xFF; 208 .loc 1 122 0 209 0040 320E lsrs r2, r6, #24 210 0042 5A72 strb r2, [r3, #9] 123:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 124:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[10] = ( sequenceCounter ) & 0xFF; 211 .loc 1 124 0 212 0044 9D72 strb r5, [r3, #10] 125:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[11] = ( sequenceCounter >> 8 ) & 0xFF; 213 .loc 1 125 0 214 0046 2A0A lsrs r2, r5, #8 215 0048 DA72 strb r2, [r3, #11] 126:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[12] = ( sequenceCounter >> 16 ) & 0xFF; 216 .loc 1 126 0 217 004a 2A0C lsrs r2, r5, #16 218 004c 1A73 strb r2, [r3, #12] 127:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[13] = ( sequenceCounter >> 24 ) & 0xFF; ARM GAS /tmp/ccDkMnY2.s page 7 219 .loc 1 127 0 220 004e 2D0E lsrs r5, r5, #24 221 0050 5D73 strb r5, [r3, #13] 112:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 222 .loc 1 112 0 223 0052 0126 movs r6, #1 224 .LVL21: 111:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** uint16_t ctr = 1; 225 .loc 1 111 0 226 0054 0025 movs r5, #0 128:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 129:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** while( size >= 16 ) 227 .loc 1 129 0 228 0056 0FE0 b .L5 229 .LVL22: 230 .L7: 130:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 131:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[15] = ( ( ctr ) & 0xFF ); 132:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** ctr++; 133:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_encrypt( aBlock, sBlock, &AesContext ); 134:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** for( i = 0; i < 16; i++ ) 135:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 136:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** encBuffer[bufferIndex + i] = buffer[bufferIndex + i] ^ sBlock[i]; 231 .loc 1 136 0 discriminator 3 232 0058 E918 adds r1, r5, r3 233 005a 625C ldrb r2, [r4, r1] 234 005c 1C48 ldr r0, .L14+8 235 005e C05C ldrb r0, [r0, r3] 236 0060 4240 eors r2, r0 237 0062 7A54 strb r2, [r7, r1] 134:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 238 .loc 1 134 0 discriminator 3 239 0064 0133 adds r3, r3, #1 240 .LVL23: 241 0066 9BB2 uxth r3, r3 242 .LVL24: 243 .L6: 134:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 244 .loc 1 134 0 is_stmt 0 discriminator 1 245 0068 0F2B cmp r3, #15 246 006a F5D9 bls .L7 137:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 138:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** size -= 16; 247 .loc 1 138 0 is_stmt 1 248 006c 4346 mov r3, r8 249 .LVL25: 250 006e 103B subs r3, r3, #16 251 0070 9BB2 uxth r3, r3 252 0072 9846 mov r8, r3 253 .LVL26: 139:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** bufferIndex += 16; 254 .loc 1 139 0 255 0074 1035 adds r5, r5, #16 256 .LVL27: 257 0076 EDB2 uxtb r5, r5 258 .LVL28: 259 .L5: ARM GAS /tmp/ccDkMnY2.s page 8 129:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 260 .loc 1 129 0 261 0078 4346 mov r3, r8 262 007a 0F2B cmp r3, #15 263 007c 09D9 bls .L12 131:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** ctr++; 264 .loc 1 131 0 265 007e 1348 ldr r0, .L14+4 266 0080 C673 strb r6, [r0, #15] 132:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_encrypt( aBlock, sBlock, &AesContext ); 267 .loc 1 132 0 268 0082 0136 adds r6, r6, #1 269 .LVL29: 270 0084 B6B2 uxth r6, r6 271 .LVL30: 133:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** for( i = 0; i < 16; i++ ) 272 .loc 1 133 0 273 0086 104A ldr r2, .L14 274 0088 1149 ldr r1, .L14+8 275 008a FFF7FEFF bl aes_encrypt 276 .LVL31: 134:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 277 .loc 1 134 0 278 008e 0023 movs r3, #0 279 0090 EAE7 b .L6 280 .LVL32: 281 .L12: 140:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 141:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 142:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** if( size > 0 ) 282 .loc 1 142 0 283 0092 002B cmp r3, #0 284 0094 04D1 bne .L13 285 .L4: 143:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 144:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aBlock[15] = ( ( ctr ) & 0xFF ); 145:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_encrypt( aBlock, sBlock, &AesContext ); 146:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** for( i = 0; i < size; i++ ) 147:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 148:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** encBuffer[bufferIndex + i] = buffer[bufferIndex + i] ^ sBlock[i]; 149:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 150:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 151:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 286 .loc 1 151 0 287 0096 03B0 add sp, sp, #12 288 @ sp needed 289 .LVL33: 290 .LVL34: 291 .LVL35: 292 .LVL36: 293 0098 0CBC pop {r2, r3} 294 009a 9046 mov r8, r2 295 009c 9B46 mov fp, r3 296 009e F0BD pop {r4, r5, r6, r7, pc} 297 .LVL37: 298 .L13: 144:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_encrypt( aBlock, sBlock, &AesContext ); ARM GAS /tmp/ccDkMnY2.s page 9 299 .loc 1 144 0 300 00a0 0A48 ldr r0, .L14+4 301 00a2 C673 strb r6, [r0, #15] 145:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** for( i = 0; i < size; i++ ) 302 .loc 1 145 0 303 00a4 084A ldr r2, .L14 304 00a6 0A49 ldr r1, .L14+8 305 00a8 FFF7FEFF bl aes_encrypt 306 .LVL38: 146:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 307 .loc 1 146 0 308 00ac 0023 movs r3, #0 309 00ae 07E0 b .L10 310 .LVL39: 311 .L11: 148:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 312 .loc 1 148 0 discriminator 3 313 00b0 E918 adds r1, r5, r3 314 00b2 625C ldrb r2, [r4, r1] 315 00b4 0648 ldr r0, .L14+8 316 00b6 C05C ldrb r0, [r0, r3] 317 00b8 4240 eors r2, r0 318 00ba 7A54 strb r2, [r7, r1] 146:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 319 .loc 1 146 0 discriminator 3 320 00bc 0133 adds r3, r3, #1 321 .LVL40: 322 00be 9BB2 uxth r3, r3 323 .LVL41: 324 .L10: 146:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 325 .loc 1 146 0 is_stmt 0 discriminator 1 326 00c0 9845 cmp r8, r3 327 00c2 F5D8 bhi .L11 328 00c4 E7E7 b .L4 329 .L15: 330 00c6 C046 .align 2 331 .L14: 332 00c8 00000000 .word AesContext 333 00cc 00000000 .word .LANCHOR2 334 00d0 00000000 .word .LANCHOR3 335 .cfi_endproc 336 .LFE83: 338 .section .text.LoRaMacPayloadDecrypt,"ax",%progbits 339 .align 1 340 .global LoRaMacPayloadDecrypt 341 .syntax unified 342 .code 16 343 .thumb_func 344 .fpu softvfp 346 LoRaMacPayloadDecrypt: 347 .LFB84: 152:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 153:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** void LoRaMacPayloadDecrypt( const uint8_t *buffer, uint16_t size, const uint8_t *key, uint32_t addr 154:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 348 .loc 1 154 0 is_stmt 1 349 .cfi_startproc ARM GAS /tmp/ccDkMnY2.s page 10 350 @ args = 12, pretend = 0, frame = 0 351 @ frame_needed = 0, uses_anonymous_args = 0 352 .LVL42: 353 0000 30B5 push {r4, r5, lr} 354 .LCFI5: 355 .cfi_def_cfa_offset 12 356 .cfi_offset 4, -12 357 .cfi_offset 5, -8 358 .cfi_offset 14, -4 359 0002 85B0 sub sp, sp, #20 360 .LCFI6: 361 .cfi_def_cfa_offset 32 362 0004 08AC add r4, sp, #32 363 .LVL43: 364 0006 2478 ldrb r4, [r4] 365 .LVL44: 155:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** LoRaMacPayloadEncrypt( buffer, size, key, address, dir, sequenceCounter, decBuffer ); 366 .loc 1 155 0 367 0008 0A9D ldr r5, [sp, #40] 368 000a 0295 str r5, [sp, #8] 369 000c 099D ldr r5, [sp, #36] 370 000e 0195 str r5, [sp, #4] 371 0010 0094 str r4, [sp] 372 0012 FFF7FEFF bl LoRaMacPayloadEncrypt 373 .LVL45: 156:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 374 .loc 1 156 0 375 0016 05B0 add sp, sp, #20 376 @ sp needed 377 0018 30BD pop {r4, r5, pc} 378 .cfi_endproc 379 .LFE84: 381 .section .text.LoRaMacJoinComputeMic,"ax",%progbits 382 .align 1 383 .global LoRaMacJoinComputeMic 384 .syntax unified 385 .code 16 386 .thumb_func 387 .fpu softvfp 389 LoRaMacJoinComputeMic: 390 .LFB85: 157:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 158:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** void LoRaMacJoinComputeMic( const uint8_t *buffer, uint16_t size, const uint8_t *key, uint32_t *mic 159:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 391 .loc 1 159 0 392 .cfi_startproc 393 @ args = 0, pretend = 0, frame = 8 394 @ frame_needed = 0, uses_anonymous_args = 0 395 .LVL46: 396 0000 F0B5 push {r4, r5, r6, r7, lr} 397 .LCFI7: 398 .cfi_def_cfa_offset 20 399 .cfi_offset 4, -20 400 .cfi_offset 5, -16 401 .cfi_offset 6, -12 402 .cfi_offset 7, -8 403 .cfi_offset 14, -4 ARM GAS /tmp/ccDkMnY2.s page 11 404 0002 83B0 sub sp, sp, #12 405 .LCFI8: 406 .cfi_def_cfa_offset 32 407 0004 0190 str r0, [sp, #4] 408 0006 0C00 movs r4, r1 409 0008 1700 movs r7, r2 410 000a 1E00 movs r6, r3 160:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** AES_CMAC_Init( AesCmacCtx ); 411 .loc 1 160 0 412 000c 0F4D ldr r5, .L18 413 000e 2800 movs r0, r5 414 .LVL47: 415 0010 FFF7FEFF bl AES_CMAC_Init 416 .LVL48: 161:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 162:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** AES_CMAC_SetKey( AesCmacCtx, key ); 417 .loc 1 162 0 418 0014 3900 movs r1, r7 419 0016 2800 movs r0, r5 420 0018 FFF7FEFF bl AES_CMAC_SetKey 421 .LVL49: 163:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 164:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** AES_CMAC_Update( AesCmacCtx, buffer, size & 0xFF ); 422 .loc 1 164 0 423 001c FF22 movs r2, #255 424 001e 2240 ands r2, r4 425 0020 0199 ldr r1, [sp, #4] 426 0022 2800 movs r0, r5 427 0024 FFF7FEFF bl AES_CMAC_Update 428 .LVL50: 165:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 166:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** AES_CMAC_Final( Mic, AesCmacCtx ); 429 .loc 1 166 0 430 0028 094C ldr r4, .L18+4 431 002a 2900 movs r1, r5 432 002c 2000 movs r0, r4 433 002e FFF7FEFF bl AES_CMAC_Final 434 .LVL51: 167:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 168:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** *mic = ( uint32_t )( ( uint32_t )Mic[3] << 24 | ( uint32_t )Mic[2] << 16 | ( uint32_t )Mic[1] < 435 .loc 1 168 0 436 0032 E378 ldrb r3, [r4, #3] 437 0034 1B06 lsls r3, r3, #24 438 0036 A278 ldrb r2, [r4, #2] 439 0038 1204 lsls r2, r2, #16 440 003a 1343 orrs r3, r2 441 003c 6278 ldrb r2, [r4, #1] 442 003e 1202 lsls r2, r2, #8 443 0040 1343 orrs r3, r2 444 0042 2278 ldrb r2, [r4] 445 0044 1343 orrs r3, r2 446 0046 3360 str r3, [r6] 169:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 447 .loc 1 169 0 448 0048 03B0 add sp, sp, #12 449 @ sp needed 450 .LVL52: ARM GAS /tmp/ccDkMnY2.s page 12 451 .LVL53: 452 004a F0BD pop {r4, r5, r6, r7, pc} 453 .L19: 454 .align 2 455 .L18: 456 004c 00000000 .word AesCmacCtx 457 0050 00000000 .word .LANCHOR1 458 .cfi_endproc 459 .LFE85: 461 .section .text.LoRaMacJoinDecrypt,"ax",%progbits 462 .align 1 463 .global LoRaMacJoinDecrypt 464 .syntax unified 465 .code 16 466 .thumb_func 467 .fpu softvfp 469 LoRaMacJoinDecrypt: 470 .LFB86: 170:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 171:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** void LoRaMacJoinDecrypt( const uint8_t *buffer, uint16_t size, const uint8_t *key, uint8_t *decBuff 172:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 471 .loc 1 172 0 472 .cfi_startproc 473 @ args = 0, pretend = 0, frame = 8 474 @ frame_needed = 0, uses_anonymous_args = 0 475 .LVL54: 476 0000 F0B5 push {r4, r5, r6, r7, lr} 477 .LCFI9: 478 .cfi_def_cfa_offset 20 479 .cfi_offset 4, -20 480 .cfi_offset 5, -16 481 .cfi_offset 6, -12 482 .cfi_offset 7, -8 483 .cfi_offset 14, -4 484 0002 83B0 sub sp, sp, #12 485 .LCFI10: 486 .cfi_def_cfa_offset 32 487 0004 0500 movs r5, r0 488 0006 0F00 movs r7, r1 489 0008 0192 str r2, [sp, #4] 490 000a 1E00 movs r6, r3 173:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** memset1( AesContext.ksch, '\0', 240 ); 491 .loc 1 173 0 492 000c 0D4C ldr r4, .L23 493 000e F022 movs r2, #240 494 .LVL55: 495 0010 0021 movs r1, #0 496 .LVL56: 497 0012 2000 movs r0, r4 498 .LVL57: 499 0014 FFF7FEFF bl memset1 500 .LVL58: 174:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_set_key( key, 16, &AesContext ); 501 .loc 1 174 0 502 0018 2200 movs r2, r4 503 001a 1021 movs r1, #16 504 001c 0198 ldr r0, [sp, #4] ARM GAS /tmp/ccDkMnY2.s page 13 505 001e FFF7FEFF bl aes_set_key 506 .LVL59: 175:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_encrypt( buffer, decBuffer, &AesContext ); 507 .loc 1 175 0 508 0022 2200 movs r2, r4 509 0024 3100 movs r1, r6 510 0026 2800 movs r0, r5 511 0028 FFF7FEFF bl aes_encrypt 512 .LVL60: 176:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** // Check if optional CFList is included 177:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** if( size >= 16 ) 513 .loc 1 177 0 514 002c 0F2F cmp r7, #15 515 002e 01D8 bhi .L22 516 .L20: 178:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 179:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_encrypt( buffer + 16, decBuffer + 16, &AesContext ); 180:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 181:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 517 .loc 1 181 0 518 0030 03B0 add sp, sp, #12 519 @ sp needed 520 .LVL61: 521 .LVL62: 522 0032 F0BD pop {r4, r5, r6, r7, pc} 523 .LVL63: 524 .L22: 179:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 525 .loc 1 179 0 526 0034 3100 movs r1, r6 527 0036 1031 adds r1, r1, #16 528 0038 2800 movs r0, r5 529 003a 1030 adds r0, r0, #16 530 003c 014A ldr r2, .L23 531 003e FFF7FEFF bl aes_encrypt 532 .LVL64: 533 .loc 1 181 0 534 0042 F5E7 b .L20 535 .L24: 536 .align 2 537 .L23: 538 0044 00000000 .word AesContext 539 .cfi_endproc 540 .LFE86: 542 .section .text.LoRaMacJoinComputeSKeys,"ax",%progbits 543 .align 1 544 .global LoRaMacJoinComputeSKeys 545 .syntax unified 546 .code 16 547 .thumb_func 548 .fpu softvfp 550 LoRaMacJoinComputeSKeys: 551 .LFB87: 182:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 183:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** void LoRaMacJoinComputeSKeys( const uint8_t *key, const uint8_t *appNonce, uint16_t devNonce, uint8 184:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** { 552 .loc 1 184 0 ARM GAS /tmp/ccDkMnY2.s page 14 553 .cfi_startproc 554 @ args = 4, pretend = 0, frame = 24 555 @ frame_needed = 0, uses_anonymous_args = 0 556 .LVL65: 557 0000 F0B5 push {r4, r5, r6, r7, lr} 558 .LCFI11: 559 .cfi_def_cfa_offset 20 560 .cfi_offset 4, -20 561 .cfi_offset 5, -16 562 .cfi_offset 6, -12 563 .cfi_offset 7, -8 564 .cfi_offset 14, -4 565 0002 87B0 sub sp, sp, #28 566 .LCFI12: 567 .cfi_def_cfa_offset 48 568 0004 0400 movs r4, r0 569 0006 0E00 movs r6, r1 570 0008 0093 str r3, [sp] 571 000a 6846 mov r0, sp 572 .LVL66: 573 000c 871D adds r7, r0, #6 574 000e C280 strh r2, [r0, #6] 575 .LVL67: 185:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** uint8_t nonce[16]; 186:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** uint8_t *pDevNonce = ( uint8_t * )&devNonce; 187:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 188:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** memset1( AesContext.ksch, '\0', 240 ); 576 .loc 1 188 0 577 0010 1F4D ldr r5, .L26 578 0012 F022 movs r2, #240 579 .LVL68: 580 0014 0021 movs r1, #0 581 .LVL69: 582 0016 2800 movs r0, r5 583 0018 FFF7FEFF bl memset1 584 .LVL70: 189:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_set_key( key, 16, &AesContext ); 585 .loc 1 189 0 586 001c 2A00 movs r2, r5 587 001e 1021 movs r1, #16 588 0020 2000 movs r0, r4 589 0022 FFF7FEFF bl aes_set_key 590 .LVL71: 190:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 191:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** memset1( nonce, 0, sizeof( nonce ) ); 591 .loc 1 191 0 592 0026 02AC add r4, sp, #8 593 .LVL72: 594 0028 1022 movs r2, #16 595 002a 0021 movs r1, #0 596 002c 2000 movs r0, r4 597 002e FFF7FEFF bl memset1 598 .LVL73: 192:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** nonce[0] = 0x01; 599 .loc 1 192 0 600 0032 0123 movs r3, #1 601 0034 2370 strb r3, [r4] ARM GAS /tmp/ccDkMnY2.s page 15 193:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** memcpy1( nonce + 1, appNonce, 6 ); 602 .loc 1 193 0 603 0036 0622 movs r2, #6 604 0038 3100 movs r1, r6 605 003a 0920 movs r0, #9 606 003c 6844 add r0, r0, sp 607 003e FFF7FEFF bl memcpy1 608 .LVL74: 194:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** memcpy1( nonce + 7, pDevNonce, 2 ); 609 .loc 1 194 0 610 0042 0222 movs r2, #2 611 0044 3900 movs r1, r7 612 0046 0F20 movs r0, #15 613 0048 6844 add r0, r0, sp 614 004a FFF7FEFF bl memcpy1 615 .LVL75: 195:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_encrypt( nonce, nwkSKey, &AesContext ); 616 .loc 1 195 0 617 004e 2A00 movs r2, r5 618 0050 0099 ldr r1, [sp] 619 0052 2000 movs r0, r4 620 0054 FFF7FEFF bl aes_encrypt 621 .LVL76: 196:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** 197:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** memset1( nonce, 0, sizeof( nonce ) ); 622 .loc 1 197 0 623 0058 1022 movs r2, #16 624 005a 0021 movs r1, #0 625 005c 2000 movs r0, r4 626 005e FFF7FEFF bl memset1 627 .LVL77: 198:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** nonce[0] = 0x02; 628 .loc 1 198 0 629 0062 0223 movs r3, #2 630 0064 2370 strb r3, [r4] 199:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** memcpy1( nonce + 1, appNonce, 6 ); 631 .loc 1 199 0 632 0066 0622 movs r2, #6 633 0068 3100 movs r1, r6 634 006a 0733 adds r3, r3, #7 635 006c 6B44 add r3, r3, sp 636 006e 1800 movs r0, r3 637 0070 FFF7FEFF bl memcpy1 638 .LVL78: 200:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** memcpy1( nonce + 7, pDevNonce, 2 ); 639 .loc 1 200 0 640 0074 0222 movs r2, #2 641 0076 3900 movs r1, r7 642 0078 0F23 movs r3, #15 643 007a 6B44 add r3, r3, sp 644 007c 1800 movs r0, r3 645 007e FFF7FEFF bl memcpy1 646 .LVL79: 201:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** aes_encrypt( nonce, appSKey, &AesContext ); 647 .loc 1 201 0 648 0082 2A00 movs r2, r5 649 0084 0C99 ldr r1, [sp, #48] ARM GAS /tmp/ccDkMnY2.s page 16 650 0086 2000 movs r0, r4 651 0088 FFF7FEFF bl aes_encrypt 652 .LVL80: 202:./Middlewares/Third_Party/Lora/Mac/LoRaMacCrypto.c **** } 653 .loc 1 202 0 654 008c 07B0 add sp, sp, #28 655 .LVL81: 656 @ sp needed 657 .LVL82: 658 .LVL83: 659 008e F0BD pop {r4, r5, r6, r7, pc} 660 .L27: 661 .align 2 662 .L26: 663 0090 00000000 .word AesContext 664 .cfi_endproc 665 .LFE87: 667 .section .bss.AesCmacCtx,"aw",%nobits 668 .align 2 671 AesCmacCtx: 672 0000 00000000 .space 280 672 00000000 672 00000000 672 00000000 672 00000000 673 .section .bss.AesContext,"aw",%nobits 674 .align 2 677 AesContext: 678 0000 00000000 .space 241 678 00000000 678 00000000 678 00000000 678 00000000 679 .section .bss.Mic,"aw",%nobits 680 .align 2 681 .set .LANCHOR1,. + 0 684 Mic: 685 0000 00000000 .space 16 685 00000000 685 00000000 685 00000000 686 .section .bss.sBlock,"aw",%nobits 687 .align 2 688 .set .LANCHOR3,. + 0 691 sBlock: 692 0000 00000000 .space 16 692 00000000 692 00000000 692 00000000 693 .section .data.MicBlockB0,"aw",%progbits 694 .align 2 695 .set .LANCHOR0,. + 0 698 MicBlockB0: 699 0000 49 .byte 73 700 0001 00 .byte 0 701 0002 00 .byte 0 702 0003 00 .byte 0 ARM GAS /tmp/ccDkMnY2.s page 17 703 0004 00 .byte 0 704 0005 00 .byte 0 705 0006 00 .byte 0 706 0007 00 .byte 0 707 0008 00 .byte 0 708 0009 00 .byte 0 709 000a 00 .byte 0 710 000b 00 .byte 0 711 000c 00 .byte 0 712 000d 00 .byte 0 713 000e 00 .byte 0 714 000f 00 .byte 0 715 .section .data.aBlock,"aw",%progbits 716 .align 2 717 .set .LANCHOR2,. + 0 720 aBlock: 721 0000 01 .byte 1 722 0001 00 .byte 0 723 0002 00 .byte 0 724 0003 00 .byte 0 725 0004 00 .byte 0 726 0005 00 .byte 0 727 0006 00 .byte 0 728 0007 00 .byte 0 729 0008 00 .byte 0 730 0009 00 .byte 0 731 000a 00 .byte 0 732 000b 00 .byte 0 733 000c 00 .byte 0 734 000d 00 .byte 0 735 000e 00 .byte 0 736 000f 00 .byte 0 737 .text 738 .Letext0: 739 .file 2 "/usr/arm-none-eabi/include/machine/_default_types.h" 740 .file 3 "/usr/arm-none-eabi/include/sys/lock.h" 741 .file 4 "/usr/arm-none-eabi/include/sys/_types.h" 742 .file 5 "/usr/lib/gcc/arm-none-eabi/7.2.0/include/stddef.h" 743 .file 6 "/usr/arm-none-eabi/include/sys/reent.h" 744 .file 7 "/usr/arm-none-eabi/include/stdlib.h" 745 .file 8 "/usr/arm-none-eabi/include/sys/_stdint.h" 746 .file 9 "/usr/arm-none-eabi/include/math.h" 747 .file 10 "Middlewares/Third_Party/Lora/Crypto/aes.h" 748 .file 11 "Middlewares/Third_Party/Lora/Crypto/cmac.h" 749 .file 12 "Middlewares/Third_Party/Lora/Utilities/utilities.h" ARM GAS /tmp/ccDkMnY2.s page 18 DEFINED SYMBOLS *ABS*:0000000000000000 LoRaMacCrypto.c /tmp/ccDkMnY2.s:16 .text.LoRaMacComputeMic:0000000000000000 $t /tmp/ccDkMnY2.s:23 .text.LoRaMacComputeMic:0000000000000000 LoRaMacComputeMic /tmp/ccDkMnY2.s:130 .text.LoRaMacComputeMic:0000000000000080 $d /tmp/ccDkMnY2.s:671 .bss.AesCmacCtx:0000000000000000 AesCmacCtx /tmp/ccDkMnY2.s:137 .text.LoRaMacPayloadEncrypt:0000000000000000 $t /tmp/ccDkMnY2.s:144 .text.LoRaMacPayloadEncrypt:0000000000000000 LoRaMacPayloadEncrypt /tmp/ccDkMnY2.s:332 .text.LoRaMacPayloadEncrypt:00000000000000c8 $d /tmp/ccDkMnY2.s:677 .bss.AesContext:0000000000000000 AesContext /tmp/ccDkMnY2.s:339 .text.LoRaMacPayloadDecrypt:0000000000000000 $t /tmp/ccDkMnY2.s:346 .text.LoRaMacPayloadDecrypt:0000000000000000 LoRaMacPayloadDecrypt /tmp/ccDkMnY2.s:382 .text.LoRaMacJoinComputeMic:0000000000000000 $t /tmp/ccDkMnY2.s:389 .text.LoRaMacJoinComputeMic:0000000000000000 LoRaMacJoinComputeMic /tmp/ccDkMnY2.s:456 .text.LoRaMacJoinComputeMic:000000000000004c $d /tmp/ccDkMnY2.s:462 .text.LoRaMacJoinDecrypt:0000000000000000 $t /tmp/ccDkMnY2.s:469 .text.LoRaMacJoinDecrypt:0000000000000000 LoRaMacJoinDecrypt /tmp/ccDkMnY2.s:538 .text.LoRaMacJoinDecrypt:0000000000000044 $d /tmp/ccDkMnY2.s:543 .text.LoRaMacJoinComputeSKeys:0000000000000000 $t /tmp/ccDkMnY2.s:550 .text.LoRaMacJoinComputeSKeys:0000000000000000 LoRaMacJoinComputeSKeys /tmp/ccDkMnY2.s:663 .text.LoRaMacJoinComputeSKeys:0000000000000090 $d /tmp/ccDkMnY2.s:668 .bss.AesCmacCtx:0000000000000000 $d /tmp/ccDkMnY2.s:674 .bss.AesContext:0000000000000000 $d /tmp/ccDkMnY2.s:680 .bss.Mic:0000000000000000 $d /tmp/ccDkMnY2.s:684 .bss.Mic:0000000000000000 Mic /tmp/ccDkMnY2.s:687 .bss.sBlock:0000000000000000 $d /tmp/ccDkMnY2.s:691 .bss.sBlock:0000000000000000 sBlock /tmp/ccDkMnY2.s:694 .data.MicBlockB0:0000000000000000 $d /tmp/ccDkMnY2.s:698 .data.MicBlockB0:0000000000000000 MicBlockB0 /tmp/ccDkMnY2.s:716 .data.aBlock:0000000000000000 $d /tmp/ccDkMnY2.s:720 .data.aBlock:0000000000000000 aBlock .debug_frame:0000000000000010 $d UNDEFINED SYMBOLS AES_CMAC_Init AES_CMAC_SetKey AES_CMAC_Update AES_CMAC_Final memset1 aes_set_key aes_encrypt memcpy1