1 ! Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
3 ! Licensed under the OpenSSL license (the "License"). You may not use
4 ! this file except in compliance with the License. You can obtain a copy
5 ! in the file LICENSE in the source distribution or at
6 ! https://www.openssl.org/source/license.html
8 ! To expand the m4 macros: m4 -B 8192 des_enc.m4 > des_enc.S
10 ! Global registers 1 to 5 are used. This is the same as done by the
11 ! cc compiler. The UltraSPARC load/store little endian feature is used.
13 ! Instruction grouping often refers to one CPU cycle.
15 ! Assemble through gcc: gcc -c -mcpu=ultrasparc -o des_enc.o des_enc.S
17 ! Assemble through cc: cc -c -xarch=v8plusa -o des_enc.o des_enc.S
19 ! Performance improvement according to './apps/openssl speed des'
22 ! 23% faster than cc-5.2 -xarch=v8plus -xO5
23 ! 115% faster than gcc-3.2.1 -m32 -mcpu=ultrasparc -O5
25 ! 50% faster than cc-5.2 -xarch=v9 -xO5
26 ! 100% faster than gcc-3.2.1 -m64 -mcpu=ultrasparc -O5
29 .ident "des_enc.m4 2.1"
30 .file "des_enc-sparc.S"
32 #include <openssl/opensslconf.h>
34 #if defined(__SUNPRO_C) && defined(__sparcv9)
35 # define ABI64 /* They've said -xarch=v9 at command line */
36 #elif defined(__GNUC__) && defined(__arch64__)
37 # define ABI64 /* They've said -m64 at command line */
41 .register %g2,#scratch
42 .register %g3,#scratch
104 ! The logic used in initial and final permutations is the same as in
105 ! the C code. The permutations are done with a clever shift, xor, and
108 ! The macro also loads address sbox 1 to 5 to global 1 to 5, address
109 ! sbox 6 to local6, and addres sbox 8 to out3.
111 ! Rotates the halfs 3 left to bring the sbox bits in convenient positions.
113 ! Loads key first round from address in parameter 5 to out0, out1.
115 ! After the the original LibDES initial permutation, the resulting left
116 ! is in the variable initially used for right and vice versa. The macro
117 ! implements the possibility to keep the halfs in the original registers.
121 ! parameter 3 result left (modify in first round)
122 ! parameter 4 result right (use in first round)
123 ! parameter 5 key address
124 ! parameter 6 1/2 for include encryption/decryption
125 ! parameter 7 1 for move in1 to in3
126 ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
127 ! parameter 9 1 for load ks3 and ks2 to in4 and in3
132 ! $1 $2 $4 $3 $5 $6 $7 $8 $9
134 ld [out2+256], local1
137 xor local4, $1, local4
138 ifelse($7,1,{mov in1, in3},{nop})
140 ld [out2+260], local2
141 and local4, local1, local4
142 ifelse($8,1,{mov in3, in4},{})
143 ifelse($8,2,{mov in4, in3},{})
145 ld [out2+280], out4 ! loop counter
146 sll local4, 4, local1
149 ld [out2+264], local3
153 ifelse($9,1,{LDPTR KS3, in4},{})
154 xor local4, $2, local4
155 nop !sethi %hi(DES_SPtrans), global1 ! sbox addr
157 ifelse($9,1,{LDPTR KS2, in3},{})
158 and local4, local2, local4
159 nop !or global1, %lo(DES_SPtrans), global1 ! sbox addr
161 sll local4, 16, local1
167 sethi %hi(16711680), local5
168 xor local4, $1, local4
170 and local4, local3, local4
171 or local5, 255, local5
173 sll local4, 2, local2
179 xor local4, $2, local4
180 add global1, 768, global4
182 and local4, local5, local4
183 add global1, 1024, global5
185 ld [out2+272], local7
186 sll local4, 8, local1
192 ld [$5], out0 ! key 7531
193 xor local4, $1, local4
194 add global1, 256, global2
196 ld [$5+4], out1 ! key 8642
197 and local4, local7, local4
198 add global1, 512, global3
200 sll local4, 1, local1
207 add global1, 1280, local6 ! address sbox 8
210 add global1, 1792, out3 ! address sbox 8
213 or local4, local3, $4
215 or local2, local1, $3
219 ld [out2+284], local5 ! 0x0000FC00 used in the rounds
220 or local2, local1, $3
224 and local1, 252, local1
230 ld [out2+284], local5 ! 0x0000FC00 used in the rounds
231 or local2, local1, $3
235 and local1, 252, local1
243 ! The logic used in the DES rounds is the same as in the C code,
244 ! except that calculations for sbox 1 and sbox 5 begin before
245 ! the previous round is finished.
247 ! In each round one half (work) is modified based on key and the
250 ! In this version we do two rounds in a loop repeated 7 times
251 ! and two rounds separately.
253 ! One half has the bits for the sboxes in the following positions:
255 ! 777777xx555555xx333333xx111111xx
257 ! 88xx666666xx444444xx222222xx8888
259 ! The bits for each sbox are xor-ed with the key bits for that box.
260 ! The above xx bits are cleared, and the result used for lookup in
261 ! the sbox table. Each sbox entry contains the 4 output bits permuted
262 ! into 32 bits according to the P permutation.
264 ! In the description of DES, left and right are switched after
265 ! each round, except after last round. In this code the original
266 ! left and right are kept in the same register in all rounds, meaning
267 ! that after the 16 rounds the result for right is in the register
268 ! originally used for left.
270 ! parameter 1 first work (left in first round)
271 ! parameter 2 first use (right in first round)
272 ! parameter 3 enc/dec 1/-1
273 ! parameter 4 loop label
274 ! parameter 5 key address register
275 ! parameter 6 optional address for key next encryption/decryption
276 ! parameter 7 not empty for include retl
278 ! also compares in2 to 8
280 define(rounds_macro, {
283 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
287 ld [out2+284], local5 ! 0x0000FC00
289 and local1, 252, local1
294 ! local6 is address sbox 6
295 ! out3 is address sbox 8
296 ! out4 is loop counter
298 ld [global1+local1], local1
299 xor $2, out1, out1 ! 8642
300 xor $2, out0, out0 ! 7531
301 ! fmovs %f0, %f0 ! fxor used for alignment
303 srl out1, 4, local0 ! rotate 4 right
304 and out0, local5, local3 ! 3
307 ld [$5+$3*8], local7 ! key 7531 next round
308 srl local3, 8, local3 ! 3
309 and local0, 252, local2 ! 2
312 ld [global3+local3],local3 ! 3
313 sll out1, 28, out1 ! rotate
314 xor $1, local1, $1 ! 1 finished, local1 now sbox 7
316 ld [global2+local2], local2 ! 2
317 srl out0, 24, local1 ! 7
318 or out1, local0, out1 ! rotate
320 ldub [out2+local1], local1 ! 7 (and 0xFC)
321 srl out1, 24, local0 ! 8
322 and out1, local5, local4 ! 4
324 ldub [out2+local0], local0 ! 8 (and 0xFC)
325 srl local4, 8, local4 ! 4
326 xor $1, local2, $1 ! 2 finished local2 now sbox 6
328 ld [global4+local4],local4 ! 4
329 srl out1, 16, local2 ! 6
330 xor $1, local3, $1 ! 3 finished local3 now sbox 5
332 ld [out3+local0],local0 ! 8
333 and local2, 252, local2 ! 6
334 add global1, 1536, local5 ! address sbox 7
336 ld [local6+local2], local2 ! 6
337 srl out0, 16, local3 ! 5
338 xor $1, local4, $1 ! 4 finished
340 ld [local5+local1],local1 ! 7
341 and local3, 252, local3 ! 5
342 xor $1, local0, $1 ! 8 finished
344 ld [global5+local3],local3 ! 5
345 xor $1, local2, $1 ! 6 finished
348 ld [$5+$3*8+4], out0 ! key 8642 next round
349 xor $1, local7, local2 ! sbox 5 next round
350 xor $1, local1, $1 ! 7 finished
352 srl local2, 16, local2 ! sbox 5 next round
353 xor $1, local3, $1 ! 5 finished
355 ld [$5+$3*16+4], out1 ! key 8642 next round again
356 and local2, 252, local2 ! sbox5 next round
358 xor $1, local7, local7 ! 7531
360 ld [global5+local2], local2 ! 5
361 srl local7, 24, local3 ! 7
362 xor $1, out0, out0 ! 8642
364 ldub [out2+local3], local3 ! 7 (and 0xFC)
365 srl out0, 4, local0 ! rotate 4 right
366 and local7, 252, local1 ! 1
368 sll out0, 28, out0 ! rotate
369 xor $2, local2, $2 ! 5 finished local2 used
371 srl local0, 8, local4 ! 4
372 and local0, 252, local2 ! 2
373 ld [local5+local3], local3 ! 7
375 srl local0, 16, local5 ! 6
376 or out0, local0, out0 ! rotate
377 ld [global2+local2], local2 ! 2
380 ld [$5+$3*16], out0 ! key 7531 next round
381 and local4, 252, local4 ! 4
383 and local5, 252, local5 ! 6
384 ld [global4+local4], local4 ! 4
385 xor $2, local3, $2 ! 7 finished local3 used
387 and local0, 252, local0 ! 8
388 ld [local6+local5], local5 ! 6
389 xor $2, local2, $2 ! 2 finished local2 now sbox 3
391 srl local7, 8, local2 ! 3 start
392 ld [out3+local0], local0 ! 8
393 xor $2, local4, $2 ! 4 finished
395 and local2, 252, local2 ! 3
396 ld [global1+local1], local1 ! 1
397 xor $2, local5, $2 ! 6 finished local5 used
399 ld [global3+local2], local2 ! 3
400 xor $2, local0, $2 ! 8 finished
401 add $5, $3*16, $5 ! enc add 8, dec add -8 to key pointer
403 ld [out2+284], local5 ! 0x0000FC00
404 xor $2, out0, local4 ! sbox 1 next round
405 xor $2, local1, $2 ! 1 finished
407 xor $2, local2, $2 ! 3 finished
409 and local4, 252, local1 ! sbox 1 next round
413 ld [global1+local1], local1
417 srl out1, 4, local0 ! rotate
418 and out0, local5, local3
420 ld [$5+$3*8], local7 ! key 7531
421 srl local3, 8, local3
422 and local0, 252, local2
424 ld [global3+local3],local3
425 sll out1, 28, out1 ! rotate
426 xor $1, local1, $1 ! 1 finished, local1 now sbox 7
428 ld [global2+local2], local2
430 or out1, local0, out1 ! rotate
432 ldub [out2+local1], local1
434 and out1, local5, local4
436 ldub [out2+local0], local0
437 srl local4, 8, local4
438 xor $1, local2, $1 ! 2 finished local2 now sbox 6
440 ld [global4+local4],local4
442 xor $1, local3, $1 ! 3 finished local3 now sbox 5
444 ld [out3+local0],local0
445 and local2, 252, local2
446 add global1, 1536, local5 ! address sbox 7
448 ld [local6+local2], local2
450 xor $1, local4, $1 ! 4 finished
452 ld [local5+local1],local1
453 and local3, 252, local3
456 ld [global5+local3],local3
457 xor $1, local2, $1 ! 6 finished
460 ifelse($6,{}, {}, {ld [out2+280], out4}) ! loop counter
461 xor $1, local7, local2 ! sbox 5 next round
462 xor $1, local1, $1 ! 7 finished
465 srl local2, 16, local2 ! sbox 5 next round
466 xor $1, local3, $1 ! 5 finished
468 and local2, 252, local2
469 ! next round (two rounds more)
470 xor $1, local7, local7 ! 7531
472 ld [global5+local2], local2
473 srl local7, 24, local3
474 xor $1, out0, out0 ! 8642
476 ldub [out2+local3], local3
477 srl out0, 4, local0 ! rotate
478 and local7, 252, local1
480 sll out0, 28, out0 ! rotate
481 xor $2, local2, $2 ! 5 finished local2 used
483 srl local0, 8, local4
484 and local0, 252, local2
485 ld [local5+local3], local3
487 srl local0, 16, local5
488 or out0, local0, out0 ! rotate
489 ld [global2+local2], local2
492 ifelse($6,{}, {}, {ld [$6], out0}) ! key next encryption/decryption
493 and local4, 252, local4
495 and local5, 252, local5
496 ld [global4+local4], local4
497 xor $2, local3, $2 ! 7 finished local3 used
499 and local0, 252, local0
500 ld [local6+local5], local5
501 xor $2, local2, $2 ! 2 finished local2 now sbox 3
503 srl local7, 8, local2 ! 3 start
504 ld [out3+local0], local0
507 and local2, 252, local2
508 ld [global1+local1], local1
509 xor $2, local5, $2 ! 6 finished local5 used
511 ld [global3+local2], local2
515 ifelse($6,{}, {}, {ld [$6+4], out1}) ! key next encryption/decryption
519 ifelse($7,{}, {}, {retl})
526 ! parameter 1 right (original left)
527 ! parameter 2 left (original right)
528 ! parameter 3 1 for optional store to [in0]
529 ! parameter 4 1 for load input/output address to local5/7
531 ! The final permutation logic switches the halves, meaning that
532 ! left and right ends up the the registers originally used.
537 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
539 ! initially undo the rotate 3 left done after initial permutation
540 ! original left is received shifted 3 right and 29 left in local3/4
543 or local3, local4, $1
546 sethi %hi(0x55555555), local2
549 or local2, %lo(0x55555555), local2
552 sethi %hi(0x00ff00ff), local1
553 xor local3, $1, local3
554 or local1, %lo(0x00ff00ff), local1
555 and local3, local2, local3
556 sethi %hi(0x33333333), local4
557 sll local3, 1, local2
563 xor local3, $2, local3
564 or local4, %lo(0x33333333), local4
565 and local3, local1, local3
566 sethi %hi(0x0000ffff), local1
567 sll local3, 8, local2
573 xor local3, $1, local3
574 or local1, %lo(0x0000ffff), local1
575 and local3, local4, local3
576 sethi %hi(0x0f0f0f0f), local4
577 sll local3, 2, local2
579 ifelse($4,1, {LDPTR INPUT, local5})
582 ifelse($4,1, {LDPTR OUTPUT, local7})
585 xor local3, $2, local3
586 or local4, %lo(0x0f0f0f0f), local4
587 and local3, local1, local3
588 sll local3, 16, local2
590 xor $2, local3, local1
592 srl local1, 4, local3
594 xor local3, $1, local3
595 and local3, local4, local3
596 sll local3, 4, local2
602 ifelse($3,1, {st $1, [in0]})
604 xor local1, local2, $2
606 ifelse($3,1, {st $2, [in0+4]})
613 ! Does initial permutation for next block mixed with
614 ! final permutation for current block.
616 ! parameter 1 original left
617 ! parameter 2 original right
618 ! parameter 3 left ip
619 ! parameter 4 right ip
620 ! parameter 5 1: load ks1/ks2 to in3/in4, add 120 to in4
623 ! also adds -8 to length in2 and loads loop counter to out4
625 define(fp_ip_macro, {
628 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
630 define({temp1},{out4})
631 define({temp2},{local3})
633 define({ip1},{local1})
634 define({ip2},{local2})
635 define({ip4},{local4})
636 define({ip5},{local5})
638 ! $1 in local3, local4
642 or local3, local4, $1
645 ifelse($5,2,{mov in4, in3})
654 and temp1, ip5, temp1
655 xor local0, $3, local0
660 and local0, ip1, local0
663 sll local0, 4, local7
673 xor local0, $4, local0
674 and temp1, ip4, temp1
675 and local0, ip2, local0
678 sll local0, 16, local7
684 ld [out2+264], temp2 ! ip3
688 xor local0, $3, local0
689 and temp1, temp2, temp1
690 and local0, temp2, local0
693 sll local0, 2, local7
701 xor local0, $4, local0
702 and temp1, ip2, temp1
703 and local0, ip4, local0
705 xor $2, temp1, local4
706 sll local0, 8, local7
713 xor local0, $3, local0
716 and local0, ip5, local0
718 sll local0, 1, local7
725 and temp1, ip1, temp1
730 ifelse($5,1,{LDPTR KS2, in4})
732 xor local4, temp2, $2
734 ! reload since used as temporary:
736 ld [out2+280], out4 ! loop counter
739 ifelse($5,1,{add in4, 120, in4})
741 ifelse($5,1,{LDPTR KS1, in3})
744 or local0, local5, $4
745 or local2, local7, $3
751 ! {load_little_endian}
753 ! parameter 1 address
754 ! parameter 2 destination left
755 ! parameter 3 destination right
756 ! parameter 4 temporary
759 define(load_little_endian, {
761 ! {load_little_endian}
762 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
764 ! first in memory to rightmost in register
800 ! {load_little_endian_inc}
802 ! parameter 1 address
803 ! parameter 2 destination left
804 ! parameter 3 destination right
805 ! parameter 4 temporary
810 define(load_little_endian_inc, {
812 ! {load_little_endian_inc}
813 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
815 ! first in memory to rightmost in register
853 ! Loads 1 to 7 bytes little endian
854 ! Remaining bytes are zeroed.
856 ! parameter 1 address
858 ! parameter 3 destination register left
859 ! parameter 4 destination register right
863 ! parameter 8 return label
865 define(load_n_bytes, {
868 ! $1 $2 $5 $6 $7 $8 $7 $8 $9
873 add %o7,$7.jmp.table-$7.0,$5
925 ! {store_little_endian}
927 ! parameter 1 address
928 ! parameter 2 source left
929 ! parameter 3 source right
930 ! parameter 4 temporary
932 define(store_little_endian, {
934 ! {store_little_endian}
935 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
937 ! rightmost in register to first in memory
976 ! Stores 1 to 7 bytes little endian
978 ! parameter 1 address
980 ! parameter 3 source register left
981 ! parameter 4 source register right
985 ! parameter 8 return label
987 define(store_n_bytes, {
990 ! $1 $2 $5 $6 $7 $8 $7 $8 $9
995 add %o7,$7.jmp.table-$7.0,$5
1048 define(testvalue,{1})
1050 define(register_init, {
1052 ! For test purposes:
1054 sethi %hi(testvalue), local0
1055 or local0, %lo(testvalue), local0
1057 ifelse($1,{},{}, {mov local0, $1})
1058 ifelse($2,{},{}, {mov local0, $2})
1059 ifelse($3,{},{}, {mov local0, $3})
1060 ifelse($4,{},{}, {mov local0, $4})
1061 ifelse($5,{},{}, {mov local0, $5})
1062 ifelse($6,{},{}, {mov local0, $6})
1063 ifelse($7,{},{}, {mov local0, $7})
1064 ifelse($8,{},{}, {mov local0, $8})
1094 ! loads key next encryption/decryption first round from [in4]
1096 rounds_macro(in5, out5, 1, .des_enc.1, in3, in4, retl)
1103 ! implemented with out5 as first parameter to avoid
1104 ! register exchange in ede modes
1107 ! loads key next encryption/decryption first round from [in3]
1109 rounds_macro(out5, in5, -1, .des_dec.1, in4, in3, retl)
1113 ! void DES_encrypt1(data, ks, enc)
1114 ! *******************************
1117 .global DES_encrypt1
1118 .type DES_encrypt1,#function
1122 save %sp, FRAME, %sp
1124 sethi %hi(.PIC.DES_SPtrans-1f),global1
1125 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1127 add %o7,global1,global1
1128 sub global1,.PIC.DES_SPtrans-.des_and,out2
1130 ld [in0], in5 ! left
1134 ld [in0+4], out5 ! right
1136 ! parameter 6 1/2 for include encryption/decryption
1137 ! parameter 7 1 for move in1 to in3
1138 ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
1140 ip_macro(in5, out5, in5, out5, in3, 0, 1, 1)
1142 rounds_macro(in5, out5, 1, .des_encrypt1.1, in3, in4) ! in4 not used
1144 fp_macro(in5, out5, 1) ! 1 for store to [in0]
1151 add in1, 120, in3 ! use last subkey for first round
1153 ! parameter 6 1/2 for include encryption/decryption
1154 ! parameter 7 1 for move in1 to in3
1155 ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
1157 ip_macro(in5, out5, out5, in5, in4, 2, 0, 1) ! include dec, ks in4
1159 fp_macro(out5, in5, 1) ! 1 for store to [in0]
1165 .size DES_encrypt1,.DES_encrypt1.end-DES_encrypt1
1168 ! void DES_encrypt2(data, ks, enc)
1169 !*********************************
1171 ! encrypts/decrypts without initial/final permutation
1174 .global DES_encrypt2
1175 .type DES_encrypt2,#function
1179 save %sp, FRAME, %sp
1181 sethi %hi(.PIC.DES_SPtrans-1f),global1
1182 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1184 add %o7,global1,global1
1185 sub global1,.PIC.DES_SPtrans-.des_and,out2
1187 ! Set sbox address 1 to 6 and rotate halfs 3 left
1188 ! Errors caught by destest? Yes. Still? *NO*
1190 !sethi %hi(DES_SPtrans), global1 ! address sbox 1
1192 !or global1, %lo(DES_SPtrans), global1 ! sbox 1
1194 add global1, 256, global2 ! sbox 2
1195 add global1, 512, global3 ! sbox 3
1197 ld [in0], out5 ! right
1198 add global1, 768, global4 ! sbox 4
1199 add global1, 1024, global5 ! sbox 5
1201 ld [in0+4], in5 ! left
1202 add global1, 1280, local6 ! sbox 6
1203 add global1, 1792, out3 ! sbox 8
1208 mov in1, in3 ! key address to in3
1214 add in5, local5, in5
1216 add out5, local7, out5
1219 ! we use our own stackframe
1222 STPTR in0, [%sp+BIAS+ARG0+0*ARGSZ]
1224 ld [in3], out0 ! key 7531 first round
1225 mov LOOPS, out4 ! loop counter
1227 ld [in3+4], out1 ! key 8642 first round
1228 sethi %hi(0x0000FC00), local5
1239 LDPTR [%sp+BIAS+ARG0+0*ARGSZ], in0
1252 ld [in4], out0 ! key 7531 first round
1253 mov LOOPS, out4 ! loop counter
1255 ld [in4+4], out1 ! key 8642 first round
1256 sethi %hi(0x0000FC00), local5
1258 mov in5, local1 ! left expected in out5
1272 LDPTR [%sp+BIAS+ARG0+0*ARGSZ], in0
1281 .size DES_encrypt2, .DES_encrypt2.end-DES_encrypt2
1284 ! void DES_encrypt3(data, ks1, ks2, ks3)
1285 ! **************************************
1288 .global DES_encrypt3
1289 .type DES_encrypt3,#function
1293 save %sp, FRAME, %sp
1295 sethi %hi(.PIC.DES_SPtrans-1f),global1
1296 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1298 add %o7,global1,global1
1299 sub global1,.PIC.DES_SPtrans-.des_and,out2
1301 ld [in0], in5 ! left
1302 add in2, 120, in4 ! ks2
1304 ld [in0+4], out5 ! right
1305 mov in3, in2 ! save ks3
1307 ! parameter 6 1/2 for include encryption/decryption
1308 ! parameter 7 1 for mov in1 to in3
1309 ! parameter 8 1 for mov in3 to in4
1310 ! parameter 9 1 for load ks3 and ks2 to in4 and in3
1312 ip_macro(in5, out5, in5, out5, in3, 1, 1, 0, 0)
1315 mov in2, in3 ! preload ks3
1320 fp_macro(in5, out5, 1)
1326 .size DES_encrypt3,.DES_encrypt3.end-DES_encrypt3
1329 ! void DES_decrypt3(data, ks1, ks2, ks3)
1330 ! **************************************
1333 .global DES_decrypt3
1334 .type DES_decrypt3,#function
1338 save %sp, FRAME, %sp
1340 sethi %hi(.PIC.DES_SPtrans-1f),global1
1341 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1343 add %o7,global1,global1
1344 sub global1,.PIC.DES_SPtrans-.des_and,out2
1346 ld [in0], in5 ! left
1347 add in3, 120, in4 ! ks3
1349 ld [in0+4], out5 ! right
1352 ! parameter 6 1/2 for include encryption/decryption
1353 ! parameter 7 1 for mov in1 to in3
1354 ! parameter 8 1 for mov in3 to in4
1355 ! parameter 9 1 for load ks3 and ks2 to in4 and in3
1357 ip_macro(in5, out5, out5, in5, in4, 2, 0, 0, 0)
1360 add in1, 120, in4 ! preload ks1
1365 fp_macro(out5, in5, 1)
1371 .size DES_decrypt3,.DES_decrypt3.end-DES_decrypt3
1373 ! void DES_ncbc_encrypt(input, output, length, schedule, ivec, enc)
1374 ! *****************************************************************
1378 .global DES_ncbc_encrypt
1379 .type DES_ncbc_encrypt,#function
1383 save %sp, FRAME, %sp
1385 define({INPUT}, { [%sp+BIAS+ARG0+0*ARGSZ] })
1386 define({OUTPUT}, { [%sp+BIAS+ARG0+1*ARGSZ] })
1387 define({IVEC}, { [%sp+BIAS+ARG0+4*ARGSZ] })
1389 sethi %hi(.PIC.DES_SPtrans-1f),global1
1390 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1392 add %o7,global1,global1
1393 sub global1,.PIC.DES_SPtrans-.des_and,out2
1400 ! addr left right temp label
1401 load_little_endian(in4, in5, out5, local3, .LLE1) ! iv
1403 addcc in2, -8, in2 ! bytes missing when first block done
1405 bl .ncbc.enc.seven.or.less
1406 mov in3, in4 ! schedule
1408 .ncbc.enc.next.block:
1410 load_little_endian(in0, out4, global4, local3, .LLE2) ! block
1412 .ncbc.enc.next.block_1:
1414 xor in5, out4, in5 ! iv xor
1415 xor out5, global4, out5 ! iv xor
1417 ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
1418 ip_macro(in5, out5, in5, out5, in3, 0, 0, 2)
1420 .ncbc.enc.next.block_2:
1422 !// call .des_enc ! compares in2 to 8
1423 ! rounds inlined for alignment purposes
1425 add global1, 768, global4 ! address sbox 4 since register used below
1427 rounds_macro(in5, out5, 1, .ncbc.enc.1, in3, in4) ! include encryption ks in3
1429 bl .ncbc.enc.next.block_fp
1430 add in0, 8, in0 ! input address
1432 ! If 8 or more bytes are to be encrypted after this block,
1433 ! we combine final permutation for this block with initial
1434 ! permutation for next block. Load next block:
1436 load_little_endian(in0, global3, global4, local5, .LLE12)
1438 ! parameter 1 original left
1439 ! parameter 2 original right
1440 ! parameter 3 left ip
1441 ! parameter 4 right ip
1442 ! parameter 5 1: load ks1/ks2 to in3/in4, add 120 to in4
1445 ! also adds -8 to length in2 and loads loop counter to out4
1447 fp_ip_macro(out0, out1, global3, global4, 2)
1449 store_little_endian(in1, out0, out1, local3, .SLE10) ! block
1451 ld [in3], out0 ! key 7531 first round next block
1453 xor global3, out5, in5 ! iv xor next block
1455 ld [in3+4], out1 ! key 8642
1456 add global1, 512, global3 ! address sbox 3 since register used
1457 xor global4, local1, out5 ! iv xor next block
1459 ba .ncbc.enc.next.block_2
1460 add in1, 8, in1 ! output address
1462 .ncbc.enc.next.block_fp:
1466 store_little_endian(in1, in5, out5, local3, .SLE1) ! block
1468 addcc in2, -8, in2 ! bytes missing when next block done
1470 bpos .ncbc.enc.next.block
1473 .ncbc.enc.seven.or.less:
1477 ble .ncbc.enc.finish
1480 add in2, 8, local1 ! bytes to load
1482 ! addr, length, dest left, dest right, temp, temp2, label, ret label
1483 load_n_bytes(in0, local1, global4, out4, local2, local3, .LNB1, .ncbc.enc.next.block_1)
1485 ! Loads 1 to 7 bytes little endian to global4, out4
1491 store_little_endian(local4, in5, out5, local5, .SLE2) ! ivec
1503 LDPTR IVEC, local7 ! ivec
1504 ble .ncbc.dec.finish
1505 mov in3, in4 ! schedule
1508 mov in0, local5 ! input
1510 load_little_endian(local7, in0, in1, local3, .LLE3) ! ivec
1512 .ncbc.dec.next.block:
1514 load_little_endian(local5, in5, out5, local3, .LLE4) ! block
1516 ! parameter 6 1/2 for include encryption/decryption
1517 ! parameter 7 1 for mov in1 to in3
1518 ! parameter 8 1 for mov in3 to in4
1520 ip_macro(in5, out5, out5, in5, in4, 2, 0, 1) ! include decryption ks in4
1522 fp_macro(out5, in5, 0, 1) ! 1 for input and output address to local5/7
1524 ! in2 is bytes left to be stored
1525 ! in2 is compared to 8 in the rounds
1527 xor out5, in0, out4 ! iv xor
1528 bl .ncbc.dec.seven.or.less
1529 xor in5, in1, global4 ! iv xor
1531 ! Load ivec next block now, since input and output address might be the same.
1533 load_little_endian_inc(local5, in0, in1, local3, .LLE5) ! iv
1535 store_little_endian(local7, out4, global4, local3, .SLE3)
1538 add local7, 8, local7
1541 bg .ncbc.dec.next.block
1542 STPTR local7, OUTPUT
1547 LDPTR IVEC, local4 ! ivec
1548 store_little_endian(local4, in0, in1, local5, .SLE4)
1555 .ncbc.dec.seven.or.less:
1557 load_little_endian_inc(local5, in0, in1, local3, .LLE13) ! ivec
1559 store_n_bytes(local7, in2, global4, out4, local3, local4, .SNB1, .ncbc.dec.store.iv)
1562 .DES_ncbc_encrypt.end:
1563 .size DES_ncbc_encrypt, .DES_ncbc_encrypt.end-DES_ncbc_encrypt
1566 ! void DES_ede3_cbc_encrypt(input, output, length, ks1, ks2, ks3, ivec, enc)
1567 ! **************************************************************************
1571 .global DES_ede3_cbc_encrypt
1572 .type DES_ede3_cbc_encrypt,#function
1574 DES_ede3_cbc_encrypt:
1576 save %sp, FRAME, %sp
1578 define({KS1}, { [%sp+BIAS+ARG0+3*ARGSZ] })
1579 define({KS2}, { [%sp+BIAS+ARG0+4*ARGSZ] })
1580 define({KS3}, { [%sp+BIAS+ARG0+5*ARGSZ] })
1582 sethi %hi(.PIC.DES_SPtrans-1f),global1
1583 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1585 add %o7,global1,global1
1586 sub global1,.PIC.DES_SPtrans-.des_and,out2
1588 LDPTR [%fp+BIAS+ARG0+7*ARGSZ], local3 ! enc
1589 LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local4 ! ivec
1597 load_little_endian(local4, in5, out5, local3, .LLE6) ! ivec
1599 addcc in2, -8, in2 ! bytes missing after next block
1601 bl .ede3.enc.seven.or.less
1604 .ede3.enc.next.block:
1606 load_little_endian(in0, out4, global4, local3, .LLE7)
1608 .ede3.enc.next.block_1:
1611 xor in5, out4, in5 ! iv xor
1612 xor out5, global4, out5 ! iv xor
1615 add in4, 120, in4 ! for decryption we use last subkey first
1618 ip_macro(in5, out5, in5, out5, in3)
1620 .ede3.enc.next.block_2:
1622 call .des_enc ! ks1 in3
1625 call .des_dec ! ks2 in4
1628 call .des_enc ! ks3 in3 compares in2 to 8
1631 bl .ede3.enc.next.block_fp
1634 ! If 8 or more bytes are to be encrypted after this block,
1635 ! we combine final permutation for this block with initial
1636 ! permutation for next block. Load next block:
1638 load_little_endian(in0, global3, global4, local5, .LLE11)
1640 ! parameter 1 original left
1641 ! parameter 2 original right
1642 ! parameter 3 left ip
1643 ! parameter 4 right ip
1644 ! parameter 5 1: load ks1/ks2 to in3/in4, add 120 to in4
1647 ! also adds -8 to length in2 and loads loop counter to out4
1649 fp_ip_macro(out0, out1, global3, global4, 1)
1651 store_little_endian(in1, out0, out1, local3, .SLE9) ! block
1654 xor global3, out5, in5 ! iv xor next block
1656 ld [in3], out0 ! key 7531
1657 add global1, 512, global3 ! address sbox 3
1658 xor global4, local1, out5 ! iv xor next block
1660 ld [in3+4], out1 ! key 8642
1661 add global1, 768, global4 ! address sbox 4
1662 ba .ede3.enc.next.block_2
1665 .ede3.enc.next.block_fp:
1669 store_little_endian(in1, in5, out5, local3, .SLE5) ! block
1671 addcc in2, -8, in2 ! bytes missing when next block done
1673 bpos .ede3.enc.next.block
1676 .ede3.enc.seven.or.less:
1680 ble .ede3.enc.finish
1683 add in2, 8, local1 ! bytes to load
1685 ! addr, length, dest left, dest right, temp, temp2, label, ret label
1686 load_n_bytes(in0, local1, global4, out4, local2, local3, .LNB2, .ede3.enc.next.block_1)
1690 LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local4 ! ivec
1691 store_little_endian(local4, in5, out5, local5, .SLE6) ! ivec
1708 ble .ede3.dec.finish
1711 LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local7 ! iv
1712 load_little_endian(local7, in0, in1, local3, .LLE8)
1714 .ede3.dec.next.block:
1716 load_little_endian(local5, in5, out5, local3, .LLE9)
1718 ! parameter 6 1/2 for include encryption/decryption
1719 ! parameter 7 1 for mov in1 to in3
1720 ! parameter 8 1 for mov in3 to in4
1721 ! parameter 9 1 for load ks3 and ks2 to in4 and in3
1723 ip_macro(in5, out5, out5, in5, in4, 2, 0, 0, 1) ! inc .des_dec ks3 in4
1725 call .des_enc ! ks2 in3
1728 call .des_dec ! ks1 in4
1731 fp_macro(out5, in5, 0, 1) ! 1 for input and output address local5/7
1733 ! in2 is bytes left to be stored
1734 ! in2 is compared to 8 in the rounds
1737 bl .ede3.dec.seven.or.less
1738 xor in5, in1, global4
1740 load_little_endian_inc(local5, in0, in1, local3, .LLE10) ! iv next block
1742 store_little_endian(local7, out4, global4, local3, .SLE7) ! block
1746 add local7, 8, local7
1748 bg .ede3.dec.next.block
1749 STPTR local7, OUTPUT
1753 LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local4 ! ivec
1754 store_little_endian(local4, in0, in1, local5, .SLE8) ! ivec
1761 .ede3.dec.seven.or.less:
1763 load_little_endian_inc(local5, in0, in1, local3, .LLE14) ! iv
1765 store_n_bytes(local7, in2, global4, out4, local3, local4, .SNB2, .ede3.dec.store.iv)
1768 .DES_ede3_cbc_encrypt.end:
1769 .size DES_ede3_cbc_encrypt,.DES_ede3_cbc_encrypt.end-DES_ede3_cbc_encrypt
1772 .type .des_and,#object
1777 ! This table is used for AND 0xFC when it is known that register
1778 ! bits 8-31 are zero. Makes it possible to do three arithmetic
1779 ! operations in one cycle.
1781 .byte 0, 0, 0, 0, 4, 4, 4, 4
1782 .byte 8, 8, 8, 8, 12, 12, 12, 12
1783 .byte 16, 16, 16, 16, 20, 20, 20, 20
1784 .byte 24, 24, 24, 24, 28, 28, 28, 28
1785 .byte 32, 32, 32, 32, 36, 36, 36, 36
1786 .byte 40, 40, 40, 40, 44, 44, 44, 44
1787 .byte 48, 48, 48, 48, 52, 52, 52, 52
1788 .byte 56, 56, 56, 56, 60, 60, 60, 60
1789 .byte 64, 64, 64, 64, 68, 68, 68, 68
1790 .byte 72, 72, 72, 72, 76, 76, 76, 76
1791 .byte 80, 80, 80, 80, 84, 84, 84, 84
1792 .byte 88, 88, 88, 88, 92, 92, 92, 92
1793 .byte 96, 96, 96, 96, 100, 100, 100, 100
1794 .byte 104, 104, 104, 104, 108, 108, 108, 108
1795 .byte 112, 112, 112, 112, 116, 116, 116, 116
1796 .byte 120, 120, 120, 120, 124, 124, 124, 124
1797 .byte 128, 128, 128, 128, 132, 132, 132, 132
1798 .byte 136, 136, 136, 136, 140, 140, 140, 140
1799 .byte 144, 144, 144, 144, 148, 148, 148, 148
1800 .byte 152, 152, 152, 152, 156, 156, 156, 156
1801 .byte 160, 160, 160, 160, 164, 164, 164, 164
1802 .byte 168, 168, 168, 168, 172, 172, 172, 172
1803 .byte 176, 176, 176, 176, 180, 180, 180, 180
1804 .byte 184, 184, 184, 184, 188, 188, 188, 188
1805 .byte 192, 192, 192, 192, 196, 196, 196, 196
1806 .byte 200, 200, 200, 200, 204, 204, 204, 204
1807 .byte 208, 208, 208, 208, 212, 212, 212, 212
1808 .byte 216, 216, 216, 216, 220, 220, 220, 220
1809 .byte 224, 224, 224, 224, 228, 228, 228, 228
1810 .byte 232, 232, 232, 232, 236, 236, 236, 236
1811 .byte 240, 240, 240, 240, 244, 244, 244, 244
1812 .byte 248, 248, 248, 248, 252, 252, 252, 252
1814 ! 5 numbers for initial/final permutation
1816 .word 0x0f0f0f0f ! offset 256
1817 .word 0x0000ffff ! 260
1818 .word 0x33333333 ! 264
1819 .word 0x00ff00ff ! 268
1820 .word 0x55555555 ! 272
1824 .word 0x0000FC00 ! 284
1827 .type DES_SPtrans,#object
1828 .size DES_SPtrans,2048
1833 .word 0x02080800, 0x00080000, 0x02000002, 0x02080802
1834 .word 0x02000000, 0x00080802, 0x00080002, 0x02000002
1835 .word 0x00080802, 0x02080800, 0x02080000, 0x00000802
1836 .word 0x02000802, 0x02000000, 0x00000000, 0x00080002
1837 .word 0x00080000, 0x00000002, 0x02000800, 0x00080800
1838 .word 0x02080802, 0x02080000, 0x00000802, 0x02000800
1839 .word 0x00000002, 0x00000800, 0x00080800, 0x02080002
1840 .word 0x00000800, 0x02000802, 0x02080002, 0x00000000
1841 .word 0x00000000, 0x02080802, 0x02000800, 0x00080002
1842 .word 0x02080800, 0x00080000, 0x00000802, 0x02000800
1843 .word 0x02080002, 0x00000800, 0x00080800, 0x02000002
1844 .word 0x00080802, 0x00000002, 0x02000002, 0x02080000
1845 .word 0x02080802, 0x00080800, 0x02080000, 0x02000802
1846 .word 0x02000000, 0x00000802, 0x00080002, 0x00000000
1847 .word 0x00080000, 0x02000000, 0x02000802, 0x02080800
1848 .word 0x00000002, 0x02080002, 0x00000800, 0x00080802
1850 .word 0x40108010, 0x00000000, 0x00108000, 0x40100000
1851 .word 0x40000010, 0x00008010, 0x40008000, 0x00108000
1852 .word 0x00008000, 0x40100010, 0x00000010, 0x40008000
1853 .word 0x00100010, 0x40108000, 0x40100000, 0x00000010
1854 .word 0x00100000, 0x40008010, 0x40100010, 0x00008000
1855 .word 0x00108010, 0x40000000, 0x00000000, 0x00100010
1856 .word 0x40008010, 0x00108010, 0x40108000, 0x40000010
1857 .word 0x40000000, 0x00100000, 0x00008010, 0x40108010
1858 .word 0x00100010, 0x40108000, 0x40008000, 0x00108010
1859 .word 0x40108010, 0x00100010, 0x40000010, 0x00000000
1860 .word 0x40000000, 0x00008010, 0x00100000, 0x40100010
1861 .word 0x00008000, 0x40000000, 0x00108010, 0x40008010
1862 .word 0x40108000, 0x00008000, 0x00000000, 0x40000010
1863 .word 0x00000010, 0x40108010, 0x00108000, 0x40100000
1864 .word 0x40100010, 0x00100000, 0x00008010, 0x40008000
1865 .word 0x40008010, 0x00000010, 0x40100000, 0x00108000
1867 .word 0x04000001, 0x04040100, 0x00000100, 0x04000101
1868 .word 0x00040001, 0x04000000, 0x04000101, 0x00040100
1869 .word 0x04000100, 0x00040000, 0x04040000, 0x00000001
1870 .word 0x04040101, 0x00000101, 0x00000001, 0x04040001
1871 .word 0x00000000, 0x00040001, 0x04040100, 0x00000100
1872 .word 0x00000101, 0x04040101, 0x00040000, 0x04000001
1873 .word 0x04040001, 0x04000100, 0x00040101, 0x04040000
1874 .word 0x00040100, 0x00000000, 0x04000000, 0x00040101
1875 .word 0x04040100, 0x00000100, 0x00000001, 0x00040000
1876 .word 0x00000101, 0x00040001, 0x04040000, 0x04000101
1877 .word 0x00000000, 0x04040100, 0x00040100, 0x04040001
1878 .word 0x00040001, 0x04000000, 0x04040101, 0x00000001
1879 .word 0x00040101, 0x04000001, 0x04000000, 0x04040101
1880 .word 0x00040000, 0x04000100, 0x04000101, 0x00040100
1881 .word 0x04000100, 0x00000000, 0x04040001, 0x00000101
1882 .word 0x04000001, 0x00040101, 0x00000100, 0x04040000
1884 .word 0x00401008, 0x10001000, 0x00000008, 0x10401008
1885 .word 0x00000000, 0x10400000, 0x10001008, 0x00400008
1886 .word 0x10401000, 0x10000008, 0x10000000, 0x00001008
1887 .word 0x10000008, 0x00401008, 0x00400000, 0x10000000
1888 .word 0x10400008, 0x00401000, 0x00001000, 0x00000008
1889 .word 0x00401000, 0x10001008, 0x10400000, 0x00001000
1890 .word 0x00001008, 0x00000000, 0x00400008, 0x10401000
1891 .word 0x10001000, 0x10400008, 0x10401008, 0x00400000
1892 .word 0x10400008, 0x00001008, 0x00400000, 0x10000008
1893 .word 0x00401000, 0x10001000, 0x00000008, 0x10400000
1894 .word 0x10001008, 0x00000000, 0x00001000, 0x00400008
1895 .word 0x00000000, 0x10400008, 0x10401000, 0x00001000
1896 .word 0x10000000, 0x10401008, 0x00401008, 0x00400000
1897 .word 0x10401008, 0x00000008, 0x10001000, 0x00401008
1898 .word 0x00400008, 0x00401000, 0x10400000, 0x10001008
1899 .word 0x00001008, 0x10000000, 0x10000008, 0x10401000
1901 .word 0x08000000, 0x00010000, 0x00000400, 0x08010420
1902 .word 0x08010020, 0x08000400, 0x00010420, 0x08010000
1903 .word 0x00010000, 0x00000020, 0x08000020, 0x00010400
1904 .word 0x08000420, 0x08010020, 0x08010400, 0x00000000
1905 .word 0x00010400, 0x08000000, 0x00010020, 0x00000420
1906 .word 0x08000400, 0x00010420, 0x00000000, 0x08000020
1907 .word 0x00000020, 0x08000420, 0x08010420, 0x00010020
1908 .word 0x08010000, 0x00000400, 0x00000420, 0x08010400
1909 .word 0x08010400, 0x08000420, 0x00010020, 0x08010000
1910 .word 0x00010000, 0x00000020, 0x08000020, 0x08000400
1911 .word 0x08000000, 0x00010400, 0x08010420, 0x00000000
1912 .word 0x00010420, 0x08000000, 0x00000400, 0x00010020
1913 .word 0x08000420, 0x00000400, 0x00000000, 0x08010420
1914 .word 0x08010020, 0x08010400, 0x00000420, 0x00010000
1915 .word 0x00010400, 0x08010020, 0x08000400, 0x00000420
1916 .word 0x00000020, 0x00010420, 0x08010000, 0x08000020
1918 .word 0x80000040, 0x00200040, 0x00000000, 0x80202000
1919 .word 0x00200040, 0x00002000, 0x80002040, 0x00200000
1920 .word 0x00002040, 0x80202040, 0x00202000, 0x80000000
1921 .word 0x80002000, 0x80000040, 0x80200000, 0x00202040
1922 .word 0x00200000, 0x80002040, 0x80200040, 0x00000000
1923 .word 0x00002000, 0x00000040, 0x80202000, 0x80200040
1924 .word 0x80202040, 0x80200000, 0x80000000, 0x00002040
1925 .word 0x00000040, 0x00202000, 0x00202040, 0x80002000
1926 .word 0x00002040, 0x80000000, 0x80002000, 0x00202040
1927 .word 0x80202000, 0x00200040, 0x00000000, 0x80002000
1928 .word 0x80000000, 0x00002000, 0x80200040, 0x00200000
1929 .word 0x00200040, 0x80202040, 0x00202000, 0x00000040
1930 .word 0x80202040, 0x00202000, 0x00200000, 0x80002040
1931 .word 0x80000040, 0x80200000, 0x00202040, 0x00000000
1932 .word 0x00002000, 0x80000040, 0x80002040, 0x80202000
1933 .word 0x80200000, 0x00002040, 0x00000040, 0x80200040
1935 .word 0x00004000, 0x00000200, 0x01000200, 0x01000004
1936 .word 0x01004204, 0x00004004, 0x00004200, 0x00000000
1937 .word 0x01000000, 0x01000204, 0x00000204, 0x01004000
1938 .word 0x00000004, 0x01004200, 0x01004000, 0x00000204
1939 .word 0x01000204, 0x00004000, 0x00004004, 0x01004204
1940 .word 0x00000000, 0x01000200, 0x01000004, 0x00004200
1941 .word 0x01004004, 0x00004204, 0x01004200, 0x00000004
1942 .word 0x00004204, 0x01004004, 0x00000200, 0x01000000
1943 .word 0x00004204, 0x01004000, 0x01004004, 0x00000204
1944 .word 0x00004000, 0x00000200, 0x01000000, 0x01004004
1945 .word 0x01000204, 0x00004204, 0x00004200, 0x00000000
1946 .word 0x00000200, 0x01000004, 0x00000004, 0x01000200
1947 .word 0x00000000, 0x01000204, 0x01000200, 0x00004200
1948 .word 0x00000204, 0x00004000, 0x01004204, 0x01000000
1949 .word 0x01004200, 0x00000004, 0x00004004, 0x01004204
1950 .word 0x01000004, 0x01004200, 0x01004000, 0x00004004
1952 .word 0x20800080, 0x20820000, 0x00020080, 0x00000000
1953 .word 0x20020000, 0x00800080, 0x20800000, 0x20820080
1954 .word 0x00000080, 0x20000000, 0x00820000, 0x00020080
1955 .word 0x00820080, 0x20020080, 0x20000080, 0x20800000
1956 .word 0x00020000, 0x00820080, 0x00800080, 0x20020000
1957 .word 0x20820080, 0x20000080, 0x00000000, 0x00820000
1958 .word 0x20000000, 0x00800000, 0x20020080, 0x20800080
1959 .word 0x00800000, 0x00020000, 0x20820000, 0x00000080
1960 .word 0x00800000, 0x00020000, 0x20000080, 0x20820080
1961 .word 0x00020080, 0x20000000, 0x00000000, 0x00820000
1962 .word 0x20800080, 0x20020080, 0x20020000, 0x00800080
1963 .word 0x20820000, 0x00000080, 0x00800080, 0x20020000
1964 .word 0x20820080, 0x00800000, 0x20800000, 0x20000080
1965 .word 0x00820000, 0x00020080, 0x20020080, 0x20800000
1966 .word 0x00000080, 0x20820000, 0x00820080, 0x00000000
1967 .word 0x20000000, 0x20800080, 0x00020000, 0x00820080