1 .cpu cortex-m4 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, 4 9 .eabi_attribute 34, 1 10 .eabi_attribute 18, 4 11 .file "simple-speck.c" 12 .text 13 .Ltext0: 14 .cfi_sections .debug_frame 15 .section .text.set_key,"ax",%progbits 16 .align 1 17 .global set_key 18 .arch armv7e-m 19 .syntax unified 20 .thumb 21 .thumb_func 22 .fpu softvfp 24 set_key: 25 .LVL0: 26 .LFB1: 27 .file 1 "simple-speck.c" 1:simple-speck.c **** #include "hal.h" 2:simple-speck.c **** #include 3:simple-speck.c **** #include 4:simple-speck.c **** 5:simple-speck.c **** #include "simpleserial.h" 6:simple-speck.c **** #include "speck.h" 7:simple-speck.c **** 8:simple-speck.c **** u8 gkey[8] = {0x00}; 9:simple-speck.c **** 10:simple-speck.c **** 11:simple-speck.c **** uint8_t get_key(uint8_t* k, uint8_t len) { 12:simple-speck.c **** simpleserial_put('o', 8, gkey); 13:simple-speck.c **** return 0x00; 14:simple-speck.c **** } 15:simple-speck.c **** 16:simple-speck.c **** uint8_t set_key(uint8_t* key, uint8_t len) { 28 .loc 1 16 44 view -0 29 .cfi_startproc 30 @ args = 0, pretend = 0, frame = 0 31 @ frame_needed = 0, uses_anonymous_args = 0 32 @ link register save eliminated. 17:simple-speck.c **** memcpy(gkey, key, 8); 33 .loc 1 17 5 view .LVU1 34 0000 034A ldr r2, .L2 35 0002 0368 ldr r3, [r0] @ unaligned 36 0004 1360 str r3, [r2] @ unaligned 37 0006 4368 ldr r3, [r0, #4] @ unaligned 38 0008 5360 str r3, [r2, #4] @ unaligned 18:simple-speck.c **** return 0x00; 39 .loc 1 18 5 view .LVU2 19:simple-speck.c **** } 40 .loc 1 19 1 is_stmt 0 view .LVU3 41 000a 0020 movs r0, #0 42 .LVL1: 43 .loc 1 19 1 view .LVU4 44 000c 7047 bx lr 45 .L3: 46 000e 00BF .align 2 47 .L2: 48 0010 00000000 .word .LANCHOR0 49 .cfi_endproc 50 .LFE1: 52 .section .text.get_key,"ax",%progbits 53 .align 1 54 .global get_key 55 .syntax unified 56 .thumb 57 .thumb_func 58 .fpu softvfp 60 get_key: 61 .LVL2: 62 .LFB0: 11:simple-speck.c **** simpleserial_put('o', 8, gkey); 63 .loc 1 11 42 is_stmt 1 view -0 64 .cfi_startproc 65 @ args = 0, pretend = 0, frame = 0 66 @ frame_needed = 0, uses_anonymous_args = 0 12:simple-speck.c **** return 0x00; 67 .loc 1 12 2 view .LVU6 11:simple-speck.c **** simpleserial_put('o', 8, gkey); 68 .loc 1 11 42 is_stmt 0 view .LVU7 69 0000 08B5 push {r3, lr} 70 .LCFI0: 71 .cfi_def_cfa_offset 8 72 .cfi_offset 3, -8 73 .cfi_offset 14, -4 12:simple-speck.c **** return 0x00; 74 .loc 1 12 2 view .LVU8 75 0002 034A ldr r2, .L5 76 0004 0821 movs r1, #8 77 .LVL3: 12:simple-speck.c **** return 0x00; 78 .loc 1 12 2 view .LVU9 79 0006 6F20 movs r0, #111 80 .LVL4: 12:simple-speck.c **** return 0x00; 81 .loc 1 12 2 view .LVU10 82 0008 FFF7FEFF bl simpleserial_put 83 .LVL5: 13:simple-speck.c **** } 84 .loc 1 13 2 is_stmt 1 view .LVU11 14:simple-speck.c **** 85 .loc 1 14 1 is_stmt 0 view .LVU12 86 000c 0020 movs r0, #0 87 000e 08BD pop {r3, pc} 88 .L6: 89 .align 2 90 .L5: 91 0010 00000000 .word .LANCHOR0 92 .cfi_endproc 93 .LFE0: 95 .section .text.reset,"ax",%progbits 96 .align 1 97 .global reset 98 .syntax unified 99 .thumb 100 .thumb_func 101 .fpu softvfp 103 reset: 104 .LVL6: 105 .LFB4: 20:simple-speck.c **** 21:simple-speck.c **** uint8_t get_pt(uint8_t* pt, uint8_t len) { 22:simple-speck.c **** /********************************** 23:simple-speck.c **** * Start user-specific code here. */ 24:simple-speck.c **** trigger_high(); 25:simple-speck.c **** 26:simple-speck.c **** // Only for testing purposes 27:simple-speck.c **** volatile uint8_t testing_output[] = {0x42, 0x41, 0x41, 0x41,0x41, 0x41, 0x41, 0x41, 0x41, 0 28:simple-speck.c **** 29:simple-speck.c **** 30:simple-speck.c **** trigger_low(); 31:simple-speck.c **** /* End user-specific code here. * 32:simple-speck.c **** ********************************/ 33:simple-speck.c **** simpleserial_put('r', 16, testing_output); 34:simple-speck.c **** 35:simple-speck.c **** return 0x00; 36:simple-speck.c **** } 37:simple-speck.c **** 38:simple-speck.c **** 39:simple-speck.c **** uint8_t encrypt_block(uint8_t* pt, uint8_t len) { 40:simple-speck.c **** 41:simple-speck.c **** trigger_high(); // TRIGGER START 42:simple-speck.c **** 43:simple-speck.c **** u8 key[8] = {0x00}; 44:simple-speck.c **** memcpy(key, gkey, 8); // copy the globally set encryption key 45:simple-speck.c **** u8 ct[4] = {0x00}; 46:simple-speck.c **** Speck3264_EncryptBlock(pt, key, ct); // the encryption happens here 47:simple-speck.c **** 48:simple-speck.c **** trigger_low(); // TRIGGER STOP 49:simple-speck.c **** 50:simple-speck.c **** simpleserial_put('c', 4, ct); 51:simple-speck.c **** return 0x00; 52:simple-speck.c **** } 53:simple-speck.c **** 54:simple-speck.c **** 55:simple-speck.c **** uint8_t reset(uint8_t* x, uint8_t len) { 106 .loc 1 55 40 is_stmt 1 view -0 107 .cfi_startproc 108 @ args = 0, pretend = 0, frame = 0 109 @ frame_needed = 0, uses_anonymous_args = 0 56:simple-speck.c **** simpleserial_put('r', 0, NULL); 110 .loc 1 56 2 view .LVU14 55:simple-speck.c **** simpleserial_put('r', 0, NULL); 111 .loc 1 55 40 is_stmt 0 view .LVU15 112 0000 08B5 push {r3, lr} 113 .LCFI1: 114 .cfi_def_cfa_offset 8 115 .cfi_offset 3, -8 116 .cfi_offset 14, -4 117 .loc 1 56 2 view .LVU16 118 0002 0022 movs r2, #0 119 0004 1146 mov r1, r2 120 .LVL7: 121 .loc 1 56 2 view .LVU17 122 0006 7220 movs r0, #114 123 .LVL8: 124 .loc 1 56 2 view .LVU18 125 0008 FFF7FEFF bl simpleserial_put 126 .LVL9: 57:simple-speck.c **** // Reset key here if needed 58:simple-speck.c **** return 0x00; 127 .loc 1 58 2 is_stmt 1 view .LVU19 59:simple-speck.c **** } 128 .loc 1 59 1 is_stmt 0 view .LVU20 129 000c 0020 movs r0, #0 130 000e 08BD pop {r3, pc} 131 .cfi_endproc 132 .LFE4: 134 .section .rodata.str1.1,"aMS",%progbits,1 135 .LC0: 136 0000 42414141 .ascii "BAAAAAAAAAAAAAAA\000" 136 41414141 136 41414141 136 41414141 136 00 137 .section .text.get_pt,"ax",%progbits 138 .align 1 139 .global get_pt 140 .syntax unified 141 .thumb 142 .thumb_func 143 .fpu softvfp 145 get_pt: 146 .LVL10: 147 .LFB2: 21:simple-speck.c **** /********************************** 148 .loc 1 21 42 is_stmt 1 view -0 149 .cfi_startproc 150 @ args = 0, pretend = 0, frame = 16 151 @ frame_needed = 0, uses_anonymous_args = 0 24:simple-speck.c **** 152 .loc 1 24 2 view .LVU22 21:simple-speck.c **** /********************************** 153 .loc 1 21 42 is_stmt 0 view .LVU23 154 0000 7FB5 push {r0, r1, r2, r3, r4, r5, r6, lr} 155 .LCFI2: 156 .cfi_def_cfa_offset 32 157 .cfi_offset 4, -16 158 .cfi_offset 5, -12 159 .cfi_offset 6, -8 160 .cfi_offset 14, -4 24:simple-speck.c **** 161 .loc 1 24 2 view .LVU24 162 0002 FFF7FEFF bl trigger_high 163 .LVL11: 27:simple-speck.c **** 164 .loc 1 27 9 is_stmt 1 view .LVU25 27:simple-speck.c **** 165 .loc 1 27 26 is_stmt 0 view .LVU26 166 0006 0B4B ldr r3, .L11 167 0008 6C46 mov r4, sp 168 000a 03F11002 add r2, r3, #16 169 000e 2646 mov r6, r4 170 .L9: 171 0010 1868 ldr r0, [r3] @ unaligned 172 0012 5968 ldr r1, [r3, #4] @ unaligned 173 0014 2546 mov r5, r4 174 0016 03C5 stmia r5!, {r0, r1} 175 0018 0833 adds r3, r3, #8 176 001a 9342 cmp r3, r2 177 001c 2C46 mov r4, r5 178 001e F7D1 bne .L9 30:simple-speck.c **** /* End user-specific code here. * 179 .loc 1 30 2 is_stmt 1 view .LVU27 180 0020 FFF7FEFF bl trigger_low 181 .LVL12: 33:simple-speck.c **** 182 .loc 1 33 2 view .LVU28 183 0024 3246 mov r2, r6 184 0026 1021 movs r1, #16 185 0028 7220 movs r0, #114 186 002a FFF7FEFF bl simpleserial_put 187 .LVL13: 35:simple-speck.c **** } 188 .loc 1 35 2 view .LVU29 36:simple-speck.c **** 189 .loc 1 36 1 is_stmt 0 view .LVU30 190 002e 0020 movs r0, #0 191 0030 04B0 add sp, sp, #16 192 .LCFI3: 193 .cfi_def_cfa_offset 16 194 @ sp needed 195 0032 70BD pop {r4, r5, r6, pc} 196 .L12: 197 .align 2 198 .L11: 199 0034 00000000 .word .LC0 200 .cfi_endproc 201 .LFE2: 203 .section .text.encrypt_block,"ax",%progbits 204 .align 1 205 .global encrypt_block 206 .syntax unified 207 .thumb 208 .thumb_func 209 .fpu softvfp 211 encrypt_block: 212 .LVL14: 213 .LFB3: 39:simple-speck.c **** 214 .loc 1 39 49 is_stmt 1 view -0 215 .cfi_startproc 216 @ args = 0, pretend = 0, frame = 16 217 @ frame_needed = 0, uses_anonymous_args = 0 41:simple-speck.c **** 218 .loc 1 41 5 view .LVU32 39:simple-speck.c **** 219 .loc 1 39 49 is_stmt 0 view .LVU33 220 0000 30B5 push {r4, r5, lr} 221 .LCFI4: 222 .cfi_def_cfa_offset 12 223 .cfi_offset 4, -12 224 .cfi_offset 5, -8 225 .cfi_offset 14, -4 226 0002 85B0 sub sp, sp, #20 227 .LCFI5: 228 .cfi_def_cfa_offset 32 39:simple-speck.c **** 229 .loc 1 39 49 view .LVU34 230 0004 0446 mov r4, r0 41:simple-speck.c **** 231 .loc 1 41 5 view .LVU35 232 0006 FFF7FEFF bl trigger_high 233 .LVL15: 43:simple-speck.c **** memcpy(key, gkey, 8); // copy the globally set encryption key 234 .loc 1 43 5 is_stmt 1 view .LVU36 44:simple-speck.c **** u8 ct[4] = {0x00}; 235 .loc 1 44 5 view .LVU37 236 000a 0B4A ldr r2, .L14 237 000c 1068 ldr r0, [r2] @ unaligned 238 000e 5168 ldr r1, [r2, #4] @ unaligned 239 0010 02AB add r3, sp, #8 240 0012 03C3 stmia r3!, {r0, r1} 45:simple-speck.c **** Speck3264_EncryptBlock(pt, key, ct); // the encryption happens here 241 .loc 1 45 5 view .LVU38 46:simple-speck.c **** 242 .loc 1 46 5 is_stmt 0 view .LVU39 243 0014 01AA add r2, sp, #4 244 0016 02A9 add r1, sp, #8 245 0018 2046 mov r0, r4 45:simple-speck.c **** Speck3264_EncryptBlock(pt, key, ct); // the encryption happens here 246 .loc 1 45 8 view .LVU40 247 001a 0025 movs r5, #0 248 001c 0195 str r5, [sp, #4] 46:simple-speck.c **** 249 .loc 1 46 5 is_stmt 1 view .LVU41 250 001e FFF7FEFF bl Speck3264_EncryptBlock 251 .LVL16: 48:simple-speck.c **** 252 .loc 1 48 5 view .LVU42 253 0022 FFF7FEFF bl trigger_low 254 .LVL17: 50:simple-speck.c **** return 0x00; 255 .loc 1 50 5 view .LVU43 256 0026 01AA add r2, sp, #4 257 0028 0421 movs r1, #4 258 002a 6320 movs r0, #99 259 002c FFF7FEFF bl simpleserial_put 260 .LVL18: 51:simple-speck.c **** } 261 .loc 1 51 5 view .LVU44 52:simple-speck.c **** 262 .loc 1 52 1 is_stmt 0 view .LVU45 263 0030 2846 mov r0, r5 264 0032 05B0 add sp, sp, #20 265 .LCFI6: 266 .cfi_def_cfa_offset 12 267 @ sp needed 268 0034 30BD pop {r4, r5, pc} 269 .LVL19: 270 .L15: 52:simple-speck.c **** 271 .loc 1 52 1 view .LVU46 272 0036 00BF .align 2 273 .L14: 274 0038 00000000 .word .LANCHOR0 275 .cfi_endproc 276 .LFE3: 278 .section .text.startup.main,"ax",%progbits 279 .align 1 280 .global main 281 .syntax unified 282 .thumb 283 .thumb_func 284 .fpu softvfp 286 main: 287 .LFB5: 60:simple-speck.c **** 61:simple-speck.c **** 62:simple-speck.c **** int main(void) { 288 .loc 1 62 16 is_stmt 1 view -0 289 .cfi_startproc 290 @ Volatile: function does not return. 291 @ args = 0, pretend = 0, frame = 0 292 @ frame_needed = 0, uses_anonymous_args = 0 63:simple-speck.c **** platform_init(); 293 .loc 1 63 5 view .LVU48 62:simple-speck.c **** platform_init(); 294 .loc 1 62 16 is_stmt 0 view .LVU49 295 0000 08B5 push {r3, lr} 296 .LCFI7: 297 .cfi_def_cfa_offset 8 298 .cfi_offset 3, -8 299 .cfi_offset 14, -4 300 .loc 1 63 5 view .LVU50 301 0002 FFF7FEFF bl platform_init 302 .LVL20: 64:simple-speck.c **** init_uart(); 303 .loc 1 64 2 is_stmt 1 view .LVU51 304 0006 FFF7FEFF bl init_uart 305 .LVL21: 65:simple-speck.c **** trigger_setup(); 306 .loc 1 65 2 view .LVU52 307 000a FFF7FEFF bl trigger_setup 308 .LVL22: 66:simple-speck.c **** 67:simple-speck.c **** /* Uncomment this to get a HELLO message for debug */ 68:simple-speck.c **** /* 69:simple-speck.c **** putch('h'); 70:simple-speck.c **** putch('e'); 71:simple-speck.c **** putch('l'); 72:simple-speck.c **** putch('l'); 73:simple-speck.c **** putch('o'); 74:simple-speck.c **** putch('\n'); 75:simple-speck.c **** */ 76:simple-speck.c **** 77:simple-speck.c **** simpleserial_init(); 309 .loc 1 77 2 view .LVU53 310 000e FFF7FEFF bl simpleserial_init 311 .LVL23: 78:simple-speck.c **** simpleserial_addcmd('p', 16, get_pt); 312 .loc 1 78 2 view .LVU54 313 0012 0E4A ldr r2, .L18 314 0014 1021 movs r1, #16 315 0016 7020 movs r0, #112 316 0018 FFF7FEFF bl simpleserial_addcmd 317 .LVL24: 79:simple-speck.c **** simpleserial_addcmd('e', 4, encrypt_block); 318 .loc 1 79 2 view .LVU55 319 001c 0C4A ldr r2, .L18+4 320 001e 0421 movs r1, #4 321 0020 6520 movs r0, #101 322 0022 FFF7FEFF bl simpleserial_addcmd 323 .LVL25: 80:simple-speck.c **** simpleserial_addcmd('k', 4, get_key); 324 .loc 1 80 2 view .LVU56 325 0026 0B4A ldr r2, .L18+8 326 0028 0421 movs r1, #4 327 002a 6B20 movs r0, #107 328 002c FFF7FEFF bl simpleserial_addcmd 329 .LVL26: 81:simple-speck.c **** simpleserial_addcmd('s', 8, set_key); 330 .loc 1 81 2 view .LVU57 331 0030 094A ldr r2, .L18+12 332 0032 0821 movs r1, #8 333 0034 7320 movs r0, #115 334 0036 FFF7FEFF bl simpleserial_addcmd 335 .LVL27: 82:simple-speck.c **** simpleserial_addcmd('x', 0, reset); 336 .loc 1 82 2 view .LVU58 337 003a 084A ldr r2, .L18+16 338 003c 0021 movs r1, #0 339 003e 7820 movs r0, #120 340 0040 FFF7FEFF bl simpleserial_addcmd 341 .LVL28: 342 .L17: 83:simple-speck.c **** 84:simple-speck.c **** while(1) 343 .loc 1 84 2 discriminator 1 view .LVU59 85:simple-speck.c **** simpleserial_get(); 344 .loc 1 85 3 discriminator 1 view .LVU60 345 0044 FFF7FEFF bl simpleserial_get 346 .LVL29: 84:simple-speck.c **** simpleserial_get(); 347 .loc 1 84 7 discriminator 1 view .LVU61 348 0048 FCE7 b .L17 349 .L19: 350 004a 00BF .align 2 351 .L18: 352 004c 00000000 .word get_pt 353 0050 00000000 .word encrypt_block 354 0054 00000000 .word get_key 355 0058 00000000 .word set_key 356 005c 00000000 .word reset 357 .cfi_endproc 358 .LFE5: 360 .global gkey 361 .bss 362 .set .LANCHOR0,. + 0 365 gkey: 366 0000 00000000 .space 8 366 00000000 367 .text 368 .Letext0: 369 .file 2 "/usr/arm-none-eabi/include/machine/_default_types.h" 370 .file 3 "/usr/arm-none-eabi/include/sys/_stdint.h" 371 .file 4 "deps//simpleserial/simpleserial.h" 372 .file 5 "deps//hal/stm32f3/stm32f3_hal.h" 373 .file 6 "deps//hal/hal.h" 374 .file 7 "speck.h" 375 .file 8 "" DEFINED SYMBOLS *ABS*:0000000000000000 simple-speck.c /tmp/cczMXntb.s:16 .text.set_key:0000000000000000 $t /tmp/cczMXntb.s:24 .text.set_key:0000000000000000 set_key /tmp/cczMXntb.s:48 .text.set_key:0000000000000010 $d /tmp/cczMXntb.s:53 .text.get_key:0000000000000000 $t /tmp/cczMXntb.s:60 .text.get_key:0000000000000000 get_key /tmp/cczMXntb.s:91 .text.get_key:0000000000000010 $d /tmp/cczMXntb.s:96 .text.reset:0000000000000000 $t /tmp/cczMXntb.s:103 .text.reset:0000000000000000 reset /tmp/cczMXntb.s:138 .text.get_pt:0000000000000000 $t /tmp/cczMXntb.s:145 .text.get_pt:0000000000000000 get_pt /tmp/cczMXntb.s:199 .text.get_pt:0000000000000034 $d /tmp/cczMXntb.s:204 .text.encrypt_block:0000000000000000 $t /tmp/cczMXntb.s:211 .text.encrypt_block:0000000000000000 encrypt_block /tmp/cczMXntb.s:274 .text.encrypt_block:0000000000000038 $d /tmp/cczMXntb.s:279 .text.startup.main:0000000000000000 $t /tmp/cczMXntb.s:286 .text.startup.main:0000000000000000 main /tmp/cczMXntb.s:352 .text.startup.main:000000000000004c $d /tmp/cczMXntb.s:365 .bss:0000000000000000 gkey /tmp/cczMXntb.s:366 .bss:0000000000000000 $d UNDEFINED SYMBOLS simpleserial_put trigger_high trigger_low Speck3264_EncryptBlock platform_init init_uart trigger_setup simpleserial_init simpleserial_addcmd simpleserial_get