simple-speck.lst 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. 1 .cpu cortex-m4
  2. 2 .eabi_attribute 20, 1
  3. 3 .eabi_attribute 21, 1
  4. 4 .eabi_attribute 23, 3
  5. 5 .eabi_attribute 24, 1
  6. 6 .eabi_attribute 25, 1
  7. 7 .eabi_attribute 26, 1
  8. 8 .eabi_attribute 30, 4
  9. 9 .eabi_attribute 34, 1
  10. 10 .eabi_attribute 18, 4
  11. 11 .file "simple-speck.c"
  12. 12 .text
  13. 13 .Ltext0:
  14. 14 .cfi_sections .debug_frame
  15. 15 .section .text.get_key,"ax",%progbits
  16. 16 .align 1
  17. 17 .global get_key
  18. 18 .arch armv7e-m
  19. 19 .syntax unified
  20. 20 .thumb
  21. 21 .thumb_func
  22. 22 .fpu softvfp
  23. 24 get_key:
  24. 25 .LVL0:
  25. 26 .LFB0:
  26. 27 .file 1 "simple-speck.c"
  27. 1:simple-speck.c **** #include "hal.h"
  28. 2:simple-speck.c **** #include <stdint.h>
  29. 3:simple-speck.c **** #include <stdlib.h>
  30. 4:simple-speck.c ****
  31. 5:simple-speck.c **** #include "simpleserial.h"
  32. 6:simple-speck.c **** #include "speck.h"
  33. 7:simple-speck.c ****
  34. 8:simple-speck.c **** u8 gkey[8] = {0x00};
  35. 9:simple-speck.c **** u8 rand_data[8] = {0x00};
  36. 10:simple-speck.c ****
  37. 11:simple-speck.c **** uint8_t get_key(uint8_t* k, uint8_t len) {
  38. 28 .loc 1 11 42 view -0
  39. 29 .cfi_startproc
  40. 30 @ args = 0, pretend = 0, frame = 0
  41. 31 @ frame_needed = 0, uses_anonymous_args = 0
  42. 12:simple-speck.c **** simpleserial_put('o', 8, gkey);
  43. 32 .loc 1 12 2 view .LVU1
  44. 11:simple-speck.c **** simpleserial_put('o', 8, gkey);
  45. 33 .loc 1 11 42 is_stmt 0 view .LVU2
  46. 34 0000 08B5 push {r3, lr}
  47. 35 .LCFI0:
  48. 36 .cfi_def_cfa_offset 8
  49. 37 .cfi_offset 3, -8
  50. 38 .cfi_offset 14, -4
  51. 39 .loc 1 12 2 view .LVU3
  52. 40 0002 034A ldr r2, .L2
  53. 41 0004 0821 movs r1, #8
  54. 42 .LVL1:
  55. 43 .loc 1 12 2 view .LVU4
  56. 44 0006 6F20 movs r0, #111
  57. 45 .LVL2:
  58. 46 .loc 1 12 2 view .LVU5
  59. 47 0008 FFF7FEFF bl simpleserial_put
  60. 48 .LVL3:
  61. 13:simple-speck.c **** return 0x00;
  62. 49 .loc 1 13 2 is_stmt 1 view .LVU6
  63. 14:simple-speck.c **** }
  64. 50 .loc 1 14 1 is_stmt 0 view .LVU7
  65. 51 000c 0020 movs r0, #0
  66. 52 000e 08BD pop {r3, pc}
  67. 53 .L3:
  68. 54 .align 2
  69. 55 .L2:
  70. 56 0010 00000000 .word .LANCHOR0
  71. 57 .cfi_endproc
  72. 58 .LFE0:
  73. 60 .section .text.reset,"ax",%progbits
  74. 61 .align 1
  75. 62 .global reset
  76. 63 .syntax unified
  77. 64 .thumb
  78. 65 .thumb_func
  79. 66 .fpu softvfp
  80. 68 reset:
  81. 69 .LVL4:
  82. 70 .LFB4:
  83. 15:simple-speck.c ****
  84. 16:simple-speck.c **** uint8_t set_key(uint8_t* key, uint8_t len) {
  85. 17:simple-speck.c **** memcpy(gkey, key, 8);
  86. 18:simple-speck.c **** int sum = 0;
  87. 19:simple-speck.c **** for(int i=0; i < 8; i++) {
  88. 20:simple-speck.c **** sum += key[i];
  89. 21:simple-speck.c **** }
  90. 22:simple-speck.c **** // initialize random value
  91. 23:simple-speck.c **** srand(sum);
  92. 24:simple-speck.c **** for(int i=0; i < 8; i++) {
  93. 25:simple-speck.c **** rand_data[i] = rand() & 0xFF;
  94. 26:simple-speck.c **** }
  95. 27:simple-speck.c **** return 0x00;
  96. 28:simple-speck.c **** }
  97. 29:simple-speck.c ****
  98. 30:simple-speck.c **** uint8_t get_pt(uint8_t* pt, uint8_t len) {
  99. 31:simple-speck.c **** /**********************************
  100. 32:simple-speck.c **** * Start user-specific code here. */
  101. 33:simple-speck.c **** trigger_high();
  102. 34:simple-speck.c ****
  103. 35:simple-speck.c **** // Only for testing purposes
  104. 36:simple-speck.c **** volatile uint8_t testing_output[] = {0x42, 0x41, 0x41, 0x41,0x41, 0x41, 0x41, 0x41, 0x41, 0
  105. 37:simple-speck.c ****
  106. 38:simple-speck.c ****
  107. 39:simple-speck.c **** trigger_low();
  108. 40:simple-speck.c **** /* End user-specific code here. *
  109. 41:simple-speck.c **** ********************************/
  110. 42:simple-speck.c **** simpleserial_put('r', 16, testing_output);
  111. 43:simple-speck.c ****
  112. 44:simple-speck.c **** return 0x00;
  113. 45:simple-speck.c **** }
  114. 46:simple-speck.c ****
  115. 47:simple-speck.c ****
  116. 48:simple-speck.c **** uint8_t encrypt_block(uint8_t* pt, uint8_t len) {
  117. 49:simple-speck.c ****
  118. 50:simple-speck.c **** trigger_high(); // TRIGGER START
  119. 51:simple-speck.c ****
  120. 52:simple-speck.c **** u8 key[8] = {0x00};
  121. 53:simple-speck.c **** memcpy(key, gkey, 8); // copy the globally set encryption key
  122. 54:simple-speck.c **** u8 ct[4] = {0x00};
  123. 55:simple-speck.c **** Speck3264_EncryptBlock(pt, key, ct, rand_data); // the encryption happens here
  124. 56:simple-speck.c ****
  125. 57:simple-speck.c **** trigger_low(); // TRIGGER STOP
  126. 58:simple-speck.c ****
  127. 59:simple-speck.c **** simpleserial_put('c', 4, ct);
  128. 60:simple-speck.c **** return 0x00;
  129. 61:simple-speck.c **** }
  130. 62:simple-speck.c ****
  131. 63:simple-speck.c ****
  132. 64:simple-speck.c **** uint8_t reset(uint8_t* x, uint8_t len) {
  133. 71 .loc 1 64 40 is_stmt 1 view -0
  134. 72 .cfi_startproc
  135. 73 @ args = 0, pretend = 0, frame = 0
  136. 74 @ frame_needed = 0, uses_anonymous_args = 0
  137. 65:simple-speck.c **** simpleserial_put('r', 0, NULL);
  138. 75 .loc 1 65 2 view .LVU9
  139. 64:simple-speck.c **** simpleserial_put('r', 0, NULL);
  140. 76 .loc 1 64 40 is_stmt 0 view .LVU10
  141. 77 0000 08B5 push {r3, lr}
  142. 78 .LCFI1:
  143. 79 .cfi_def_cfa_offset 8
  144. 80 .cfi_offset 3, -8
  145. 81 .cfi_offset 14, -4
  146. 82 .loc 1 65 2 view .LVU11
  147. 83 0002 0022 movs r2, #0
  148. 84 0004 1146 mov r1, r2
  149. 85 .LVL5:
  150. 86 .loc 1 65 2 view .LVU12
  151. 87 0006 7220 movs r0, #114
  152. 88 .LVL6:
  153. 89 .loc 1 65 2 view .LVU13
  154. 90 0008 FFF7FEFF bl simpleserial_put
  155. 91 .LVL7:
  156. 66:simple-speck.c **** // Reset key here if needed
  157. 67:simple-speck.c **** return 0x00;
  158. 92 .loc 1 67 2 is_stmt 1 view .LVU14
  159. 68:simple-speck.c **** }
  160. 93 .loc 1 68 1 is_stmt 0 view .LVU15
  161. 94 000c 0020 movs r0, #0
  162. 95 000e 08BD pop {r3, pc}
  163. 96 .cfi_endproc
  164. 97 .LFE4:
  165. 99 .section .text.set_key,"ax",%progbits
  166. 100 .align 1
  167. 101 .global set_key
  168. 102 .syntax unified
  169. 103 .thumb
  170. 104 .thumb_func
  171. 105 .fpu softvfp
  172. 107 set_key:
  173. 108 .LVL8:
  174. 109 .LFB1:
  175. 16:simple-speck.c **** memcpy(gkey, key, 8);
  176. 110 .loc 1 16 44 is_stmt 1 view -0
  177. 111 .cfi_startproc
  178. 112 @ args = 0, pretend = 0, frame = 0
  179. 113 @ frame_needed = 0, uses_anonymous_args = 0
  180. 17:simple-speck.c **** int sum = 0;
  181. 114 .loc 1 17 5 view .LVU17
  182. 16:simple-speck.c **** memcpy(gkey, key, 8);
  183. 115 .loc 1 16 44 is_stmt 0 view .LVU18
  184. 116 0000 38B5 push {r3, r4, r5, lr}
  185. 117 .LCFI2:
  186. 118 .cfi_def_cfa_offset 16
  187. 119 .cfi_offset 3, -16
  188. 120 .cfi_offset 4, -12
  189. 121 .cfi_offset 5, -8
  190. 122 .cfi_offset 14, -4
  191. 17:simple-speck.c **** int sum = 0;
  192. 123 .loc 1 17 5 view .LVU19
  193. 124 0002 0D4A ldr r2, .L10
  194. 125 0004 0368 ldr r3, [r0] @ unaligned
  195. 126 0006 1360 str r3, [r2] @ unaligned
  196. 127 0008 4368 ldr r3, [r0, #4] @ unaligned
  197. 128 000a 5360 str r3, [r2, #4] @ unaligned
  198. 18:simple-speck.c **** for(int i=0; i < 8; i++) {
  199. 129 .loc 1 18 5 is_stmt 1 view .LVU20
  200. 130 .LVL9:
  201. 19:simple-speck.c **** sum += key[i];
  202. 131 .loc 1 19 5 view .LVU21
  203. 132 .LBB2:
  204. 19:simple-speck.c **** sum += key[i];
  205. 133 .loc 1 19 9 view .LVU22
  206. 19:simple-speck.c **** sum += key[i];
  207. 134 .loc 1 19 20 view .LVU23
  208. 135 000c 421E subs r2, r0, #1
  209. 136 000e C31D adds r3, r0, #7
  210. 137 .LBE2:
  211. 18:simple-speck.c **** for(int i=0; i < 8; i++) {
  212. 138 .loc 1 18 9 is_stmt 0 view .LVU24
  213. 139 0010 0020 movs r0, #0
  214. 140 .LVL10:
  215. 141 .L6:
  216. 142 .LBB3:
  217. 20:simple-speck.c **** }
  218. 143 .loc 1 20 9 is_stmt 1 discriminator 3 view .LVU25
  219. 20:simple-speck.c **** }
  220. 144 .loc 1 20 19 is_stmt 0 discriminator 3 view .LVU26
  221. 145 0012 12F8011F ldrb r1, [r2, #1]! @ zero_extendqisi2
  222. 146 .LVL11:
  223. 19:simple-speck.c **** sum += key[i];
  224. 147 .loc 1 19 20 discriminator 3 view .LVU27
  225. 148 0016 9A42 cmp r2, r3
  226. 20:simple-speck.c **** }
  227. 149 .loc 1 20 13 discriminator 3 view .LVU28
  228. 150 0018 0844 add r0, r0, r1
  229. 151 .LVL12:
  230. 19:simple-speck.c **** sum += key[i];
  231. 152 .loc 1 19 26 is_stmt 1 discriminator 3 view .LVU29
  232. 19:simple-speck.c **** sum += key[i];
  233. 153 .loc 1 19 20 discriminator 3 view .LVU30
  234. 154 001a FAD1 bne .L6
  235. 155 .LBE3:
  236. 23:simple-speck.c **** for(int i=0; i < 8; i++) {
  237. 156 .loc 1 23 5 view .LVU31
  238. 157 001c FFF7FEFF bl srand
  239. 158 .LVL13:
  240. 24:simple-speck.c **** rand_data[i] = rand() & 0xFF;
  241. 159 .loc 1 24 5 view .LVU32
  242. 160 .LBB4:
  243. 24:simple-speck.c **** rand_data[i] = rand() & 0xFF;
  244. 161 .loc 1 24 9 view .LVU33
  245. 24:simple-speck.c **** rand_data[i] = rand() & 0xFF;
  246. 162 .loc 1 24 20 view .LVU34
  247. 163 0020 064D ldr r5, .L10+4
  248. 24:simple-speck.c **** rand_data[i] = rand() & 0xFF;
  249. 164 .loc 1 24 13 is_stmt 0 view .LVU35
  250. 165 0022 0024 movs r4, #0
  251. 166 .LVL14:
  252. 167 .L7:
  253. 25:simple-speck.c **** }
  254. 168 .loc 1 25 9 is_stmt 1 discriminator 3 view .LVU36
  255. 25:simple-speck.c **** }
  256. 169 .loc 1 25 24 is_stmt 0 discriminator 3 view .LVU37
  257. 170 0024 FFF7FEFF bl rand
  258. 171 .LVL15:
  259. 24:simple-speck.c **** rand_data[i] = rand() & 0xFF;
  260. 172 .loc 1 24 26 discriminator 3 view .LVU38
  261. 173 0028 0134 adds r4, r4, #1
  262. 174 .LVL16:
  263. 24:simple-speck.c **** rand_data[i] = rand() & 0xFF;
  264. 175 .loc 1 24 20 discriminator 3 view .LVU39
  265. 176 002a 082C cmp r4, #8
  266. 25:simple-speck.c **** }
  267. 177 .loc 1 25 22 discriminator 3 view .LVU40
  268. 178 002c 05F8010B strb r0, [r5], #1
  269. 24:simple-speck.c **** rand_data[i] = rand() & 0xFF;
  270. 179 .loc 1 24 26 is_stmt 1 discriminator 3 view .LVU41
  271. 180 .LVL17:
  272. 24:simple-speck.c **** rand_data[i] = rand() & 0xFF;
  273. 181 .loc 1 24 20 discriminator 3 view .LVU42
  274. 182 0030 F8D1 bne .L7
  275. 183 .LBE4:
  276. 27:simple-speck.c **** }
  277. 184 .loc 1 27 5 view .LVU43
  278. 28:simple-speck.c ****
  279. 185 .loc 1 28 1 is_stmt 0 view .LVU44
  280. 186 0032 0020 movs r0, #0
  281. 187 0034 38BD pop {r3, r4, r5, pc}
  282. 188 .LVL18:
  283. 189 .L11:
  284. 28:simple-speck.c ****
  285. 190 .loc 1 28 1 view .LVU45
  286. 191 0036 00BF .align 2
  287. 192 .L10:
  288. 193 0038 00000000 .word .LANCHOR0
  289. 194 003c 08000000 .word .LANCHOR0+8
  290. 195 .cfi_endproc
  291. 196 .LFE1:
  292. 198 .section .rodata.str1.1,"aMS",%progbits,1
  293. 199 .LC0:
  294. 200 0000 42414141 .ascii "BAAAAAAAAAAAAAAA\000"
  295. 200 41414141
  296. 200 41414141
  297. 200 41414141
  298. 200 00
  299. 201 .section .text.get_pt,"ax",%progbits
  300. 202 .align 1
  301. 203 .global get_pt
  302. 204 .syntax unified
  303. 205 .thumb
  304. 206 .thumb_func
  305. 207 .fpu softvfp
  306. 209 get_pt:
  307. 210 .LVL19:
  308. 211 .LFB2:
  309. 30:simple-speck.c **** /**********************************
  310. 212 .loc 1 30 42 is_stmt 1 view -0
  311. 213 .cfi_startproc
  312. 214 @ args = 0, pretend = 0, frame = 16
  313. 215 @ frame_needed = 0, uses_anonymous_args = 0
  314. 33:simple-speck.c ****
  315. 216 .loc 1 33 2 view .LVU47
  316. 30:simple-speck.c **** /**********************************
  317. 217 .loc 1 30 42 is_stmt 0 view .LVU48
  318. 218 0000 7FB5 push {r0, r1, r2, r3, r4, r5, r6, lr}
  319. 219 .LCFI3:
  320. 220 .cfi_def_cfa_offset 32
  321. 221 .cfi_offset 4, -16
  322. 222 .cfi_offset 5, -12
  323. 223 .cfi_offset 6, -8
  324. 224 .cfi_offset 14, -4
  325. 33:simple-speck.c ****
  326. 225 .loc 1 33 2 view .LVU49
  327. 226 0002 FFF7FEFF bl trigger_high
  328. 227 .LVL20:
  329. 36:simple-speck.c ****
  330. 228 .loc 1 36 9 is_stmt 1 view .LVU50
  331. 36:simple-speck.c ****
  332. 229 .loc 1 36 26 is_stmt 0 view .LVU51
  333. 230 0006 0B4B ldr r3, .L15
  334. 231 0008 6C46 mov r4, sp
  335. 232 000a 03F11002 add r2, r3, #16
  336. 233 000e 2646 mov r6, r4
  337. 234 .L13:
  338. 235 0010 1868 ldr r0, [r3] @ unaligned
  339. 236 0012 5968 ldr r1, [r3, #4] @ unaligned
  340. 237 0014 2546 mov r5, r4
  341. 238 0016 03C5 stmia r5!, {r0, r1}
  342. 239 0018 0833 adds r3, r3, #8
  343. 240 001a 9342 cmp r3, r2
  344. 241 001c 2C46 mov r4, r5
  345. 242 001e F7D1 bne .L13
  346. 39:simple-speck.c **** /* End user-specific code here. *
  347. 243 .loc 1 39 2 is_stmt 1 view .LVU52
  348. 244 0020 FFF7FEFF bl trigger_low
  349. 245 .LVL21:
  350. 42:simple-speck.c ****
  351. 246 .loc 1 42 2 view .LVU53
  352. 247 0024 3246 mov r2, r6
  353. 248 0026 1021 movs r1, #16
  354. 249 0028 7220 movs r0, #114
  355. 250 002a FFF7FEFF bl simpleserial_put
  356. 251 .LVL22:
  357. 44:simple-speck.c **** }
  358. 252 .loc 1 44 2 view .LVU54
  359. 45:simple-speck.c ****
  360. 253 .loc 1 45 1 is_stmt 0 view .LVU55
  361. 254 002e 0020 movs r0, #0
  362. 255 0030 04B0 add sp, sp, #16
  363. 256 .LCFI4:
  364. 257 .cfi_def_cfa_offset 16
  365. 258 @ sp needed
  366. 259 0032 70BD pop {r4, r5, r6, pc}
  367. 260 .L16:
  368. 261 .align 2
  369. 262 .L15:
  370. 263 0034 00000000 .word .LC0
  371. 264 .cfi_endproc
  372. 265 .LFE2:
  373. 267 .section .text.encrypt_block,"ax",%progbits
  374. 268 .align 1
  375. 269 .global encrypt_block
  376. 270 .syntax unified
  377. 271 .thumb
  378. 272 .thumb_func
  379. 273 .fpu softvfp
  380. 275 encrypt_block:
  381. 276 .LVL23:
  382. 277 .LFB3:
  383. 48:simple-speck.c ****
  384. 278 .loc 1 48 49 is_stmt 1 view -0
  385. 279 .cfi_startproc
  386. 280 @ args = 0, pretend = 0, frame = 16
  387. 281 @ frame_needed = 0, uses_anonymous_args = 0
  388. 50:simple-speck.c ****
  389. 282 .loc 1 50 5 view .LVU57
  390. 48:simple-speck.c ****
  391. 283 .loc 1 48 49 is_stmt 0 view .LVU58
  392. 284 0000 30B5 push {r4, r5, lr}
  393. 285 .LCFI5:
  394. 286 .cfi_def_cfa_offset 12
  395. 287 .cfi_offset 4, -12
  396. 288 .cfi_offset 5, -8
  397. 289 .cfi_offset 14, -4
  398. 290 0002 85B0 sub sp, sp, #20
  399. 291 .LCFI6:
  400. 292 .cfi_def_cfa_offset 32
  401. 48:simple-speck.c ****
  402. 293 .loc 1 48 49 view .LVU59
  403. 294 0004 0446 mov r4, r0
  404. 50:simple-speck.c ****
  405. 295 .loc 1 50 5 view .LVU60
  406. 296 0006 FFF7FEFF bl trigger_high
  407. 297 .LVL24:
  408. 52:simple-speck.c **** memcpy(key, gkey, 8); // copy the globally set encryption key
  409. 298 .loc 1 52 5 is_stmt 1 view .LVU61
  410. 53:simple-speck.c **** u8 ct[4] = {0x00};
  411. 299 .loc 1 53 5 view .LVU62
  412. 300 000a 0B4B ldr r3, .L18
  413. 301 000c 1868 ldr r0, [r3] @ unaligned
  414. 302 000e 5968 ldr r1, [r3, #4] @ unaligned
  415. 303 0010 02AA add r2, sp, #8
  416. 304 0012 03C2 stmia r2!, {r0, r1}
  417. 54:simple-speck.c **** Speck3264_EncryptBlock(pt, key, ct, rand_data); // the encryption happens here
  418. 305 .loc 1 54 5 view .LVU63
  419. 55:simple-speck.c ****
  420. 306 .loc 1 55 5 is_stmt 0 view .LVU64
  421. 307 0014 0833 adds r3, r3, #8
  422. 308 0016 01AA add r2, sp, #4
  423. 309 0018 02A9 add r1, sp, #8
  424. 310 001a 2046 mov r0, r4
  425. 54:simple-speck.c **** Speck3264_EncryptBlock(pt, key, ct, rand_data); // the encryption happens here
  426. 311 .loc 1 54 8 view .LVU65
  427. 312 001c 0025 movs r5, #0
  428. 313 001e 0195 str r5, [sp, #4]
  429. 55:simple-speck.c ****
  430. 314 .loc 1 55 5 is_stmt 1 view .LVU66
  431. 315 0020 FFF7FEFF bl Speck3264_EncryptBlock
  432. 316 .LVL25:
  433. 57:simple-speck.c ****
  434. 317 .loc 1 57 5 view .LVU67
  435. 318 0024 FFF7FEFF bl trigger_low
  436. 319 .LVL26:
  437. 59:simple-speck.c **** return 0x00;
  438. 320 .loc 1 59 5 view .LVU68
  439. 321 0028 01AA add r2, sp, #4
  440. 322 002a 0421 movs r1, #4
  441. 323 002c 6320 movs r0, #99
  442. 324 002e FFF7FEFF bl simpleserial_put
  443. 325 .LVL27:
  444. 60:simple-speck.c **** }
  445. 326 .loc 1 60 5 view .LVU69
  446. 61:simple-speck.c ****
  447. 327 .loc 1 61 1 is_stmt 0 view .LVU70
  448. 328 0032 2846 mov r0, r5
  449. 329 0034 05B0 add sp, sp, #20
  450. 330 .LCFI7:
  451. 331 .cfi_def_cfa_offset 12
  452. 332 @ sp needed
  453. 333 0036 30BD pop {r4, r5, pc}
  454. 334 .LVL28:
  455. 335 .L19:
  456. 61:simple-speck.c ****
  457. 336 .loc 1 61 1 view .LVU71
  458. 337 .align 2
  459. 338 .L18:
  460. 339 0038 00000000 .word .LANCHOR0
  461. 340 .cfi_endproc
  462. 341 .LFE3:
  463. 343 .section .text.startup.main,"ax",%progbits
  464. 344 .align 1
  465. 345 .global main
  466. 346 .syntax unified
  467. 347 .thumb
  468. 348 .thumb_func
  469. 349 .fpu softvfp
  470. 351 main:
  471. 352 .LFB5:
  472. 69:simple-speck.c ****
  473. 70:simple-speck.c ****
  474. 71:simple-speck.c **** int main(void) {
  475. 353 .loc 1 71 16 is_stmt 1 view -0
  476. 354 .cfi_startproc
  477. 355 @ Volatile: function does not return.
  478. 356 @ args = 0, pretend = 0, frame = 0
  479. 357 @ frame_needed = 0, uses_anonymous_args = 0
  480. 72:simple-speck.c **** platform_init();
  481. 358 .loc 1 72 5 view .LVU73
  482. 71:simple-speck.c **** platform_init();
  483. 359 .loc 1 71 16 is_stmt 0 view .LVU74
  484. 360 0000 08B5 push {r3, lr}
  485. 361 .LCFI8:
  486. 362 .cfi_def_cfa_offset 8
  487. 363 .cfi_offset 3, -8
  488. 364 .cfi_offset 14, -4
  489. 365 .loc 1 72 5 view .LVU75
  490. 366 0002 FFF7FEFF bl platform_init
  491. 367 .LVL29:
  492. 73:simple-speck.c **** init_uart();
  493. 368 .loc 1 73 2 is_stmt 1 view .LVU76
  494. 369 0006 FFF7FEFF bl init_uart
  495. 370 .LVL30:
  496. 74:simple-speck.c **** trigger_setup();
  497. 371 .loc 1 74 2 view .LVU77
  498. 372 000a FFF7FEFF bl trigger_setup
  499. 373 .LVL31:
  500. 75:simple-speck.c ****
  501. 76:simple-speck.c **** /* Uncomment this to get a HELLO message for debug */
  502. 77:simple-speck.c **** /*
  503. 78:simple-speck.c **** putch('h');
  504. 79:simple-speck.c **** putch('e');
  505. 80:simple-speck.c **** putch('l');
  506. 81:simple-speck.c **** putch('l');
  507. 82:simple-speck.c **** putch('o');
  508. 83:simple-speck.c **** putch('\n');
  509. 84:simple-speck.c **** */
  510. 85:simple-speck.c ****
  511. 86:simple-speck.c **** simpleserial_init();
  512. 374 .loc 1 86 2 view .LVU78
  513. 375 000e FFF7FEFF bl simpleserial_init
  514. 376 .LVL32:
  515. 87:simple-speck.c **** simpleserial_addcmd('p', 16, get_pt);
  516. 377 .loc 1 87 2 view .LVU79
  517. 378 0012 0E4A ldr r2, .L22
  518. 379 0014 1021 movs r1, #16
  519. 380 0016 7020 movs r0, #112
  520. 381 0018 FFF7FEFF bl simpleserial_addcmd
  521. 382 .LVL33:
  522. 88:simple-speck.c **** simpleserial_addcmd('e', 4, encrypt_block);
  523. 383 .loc 1 88 2 view .LVU80
  524. 384 001c 0C4A ldr r2, .L22+4
  525. 385 001e 0421 movs r1, #4
  526. 386 0020 6520 movs r0, #101
  527. 387 0022 FFF7FEFF bl simpleserial_addcmd
  528. 388 .LVL34:
  529. 89:simple-speck.c **** simpleserial_addcmd('k', 4, get_key);
  530. 389 .loc 1 89 2 view .LVU81
  531. 390 0026 0B4A ldr r2, .L22+8
  532. 391 0028 0421 movs r1, #4
  533. 392 002a 6B20 movs r0, #107
  534. 393 002c FFF7FEFF bl simpleserial_addcmd
  535. 394 .LVL35:
  536. 90:simple-speck.c **** simpleserial_addcmd('s', 8, set_key);
  537. 395 .loc 1 90 2 view .LVU82
  538. 396 0030 094A ldr r2, .L22+12
  539. 397 0032 0821 movs r1, #8
  540. 398 0034 7320 movs r0, #115
  541. 399 0036 FFF7FEFF bl simpleserial_addcmd
  542. 400 .LVL36:
  543. 91:simple-speck.c **** simpleserial_addcmd('x', 0, reset);
  544. 401 .loc 1 91 2 view .LVU83
  545. 402 003a 084A ldr r2, .L22+16
  546. 403 003c 0021 movs r1, #0
  547. 404 003e 7820 movs r0, #120
  548. 405 0040 FFF7FEFF bl simpleserial_addcmd
  549. 406 .LVL37:
  550. 407 .L21:
  551. 92:simple-speck.c ****
  552. 93:simple-speck.c **** while(1)
  553. 408 .loc 1 93 2 discriminator 1 view .LVU84
  554. 94:simple-speck.c **** simpleserial_get();
  555. 409 .loc 1 94 3 discriminator 1 view .LVU85
  556. 410 0044 FFF7FEFF bl simpleserial_get
  557. 411 .LVL38:
  558. 93:simple-speck.c **** simpleserial_get();
  559. 412 .loc 1 93 7 discriminator 1 view .LVU86
  560. 413 0048 FCE7 b .L21
  561. 414 .L23:
  562. 415 004a 00BF .align 2
  563. 416 .L22:
  564. 417 004c 00000000 .word get_pt
  565. 418 0050 00000000 .word encrypt_block
  566. 419 0054 00000000 .word get_key
  567. 420 0058 00000000 .word set_key
  568. 421 005c 00000000 .word reset
  569. 422 .cfi_endproc
  570. 423 .LFE5:
  571. 425 .global rand_data
  572. 426 .global gkey
  573. 427 .bss
  574. 428 .set .LANCHOR0,. + 0
  575. 431 gkey:
  576. 432 0000 00000000 .space 8
  577. 432 00000000
  578. 435 rand_data:
  579. 436 0008 00000000 .space 8
  580. 436 00000000
  581. 437 .text
  582. 438 .Letext0:
  583. 439 .file 2 "/usr/arm-none-eabi/include/machine/_default_types.h"
  584. 440 .file 3 "/usr/arm-none-eabi/include/sys/_stdint.h"
  585. 441 .file 4 "deps//simpleserial/simpleserial.h"
  586. 442 .file 5 "deps//hal/stm32f3/stm32f3_hal.h"
  587. 443 .file 6 "deps//hal/hal.h"
  588. 444 .file 7 "speck.h"
  589. 445 .file 8 "/usr/arm-none-eabi/include/stdlib.h"
  590. 446 .file 9 "<built-in>"
  591. DEFINED SYMBOLS
  592. *ABS*:0000000000000000 simple-speck.c
  593. /tmp/ccLR1Kpf.s:16 .text.get_key:0000000000000000 $t
  594. /tmp/ccLR1Kpf.s:24 .text.get_key:0000000000000000 get_key
  595. /tmp/ccLR1Kpf.s:56 .text.get_key:0000000000000010 $d
  596. /tmp/ccLR1Kpf.s:61 .text.reset:0000000000000000 $t
  597. /tmp/ccLR1Kpf.s:68 .text.reset:0000000000000000 reset
  598. /tmp/ccLR1Kpf.s:100 .text.set_key:0000000000000000 $t
  599. /tmp/ccLR1Kpf.s:107 .text.set_key:0000000000000000 set_key
  600. /tmp/ccLR1Kpf.s:193 .text.set_key:0000000000000038 $d
  601. /tmp/ccLR1Kpf.s:202 .text.get_pt:0000000000000000 $t
  602. /tmp/ccLR1Kpf.s:209 .text.get_pt:0000000000000000 get_pt
  603. /tmp/ccLR1Kpf.s:263 .text.get_pt:0000000000000034 $d
  604. /tmp/ccLR1Kpf.s:268 .text.encrypt_block:0000000000000000 $t
  605. /tmp/ccLR1Kpf.s:275 .text.encrypt_block:0000000000000000 encrypt_block
  606. /tmp/ccLR1Kpf.s:339 .text.encrypt_block:0000000000000038 $d
  607. /tmp/ccLR1Kpf.s:344 .text.startup.main:0000000000000000 $t
  608. /tmp/ccLR1Kpf.s:351 .text.startup.main:0000000000000000 main
  609. /tmp/ccLR1Kpf.s:417 .text.startup.main:000000000000004c $d
  610. /tmp/ccLR1Kpf.s:435 .bss:0000000000000008 rand_data
  611. /tmp/ccLR1Kpf.s:431 .bss:0000000000000000 gkey
  612. /tmp/ccLR1Kpf.s:432 .bss:0000000000000000 $d
  613. UNDEFINED SYMBOLS
  614. simpleserial_put
  615. srand
  616. rand
  617. trigger_high
  618. trigger_low
  619. Speck3264_EncryptBlock
  620. platform_init
  621. init_uart
  622. trigger_setup
  623. simpleserial_init
  624. simpleserial_addcmd
  625. simpleserial_get