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 #ifdef OPENSSL_FIPSCANISTER
35 #include <openssl/fipssyms.h>
38 #if defined(__SUNPRO_C) && defined(__sparcv9)
39 # define ABI64 /* They've said -xarch=v9 at command line */
40 #elif defined(__GNUC__) && defined(__arch64__)
41 # define ABI64 /* They've said -m64 at command line */
45 .register %g2,#scratch
46 .register %g3,#scratch
108 ! The logic used in initial and final permutations is the same as in
109 ! the C code. The permutations are done with a clever shift, xor, and
112 ! The macro also loads address sbox 1 to 5 to global 1 to 5, address
113 ! sbox 6 to local6, and addres sbox 8 to out3.
115 ! Rotates the halfs 3 left to bring the sbox bits in convenient positions.
117 ! Loads key first round from address in parameter 5 to out0, out1.
119 ! After the the original LibDES initial permutation, the resulting left
120 ! is in the variable initially used for right and vice versa. The macro
121 ! implements the possibility to keep the halfs in the original registers.
125 ! parameter 3 result left (modify in first round)
126 ! parameter 4 result right (use in first round)
127 ! parameter 5 key address
128 ! parameter 6 1/2 for include encryption/decryption
129 ! parameter 7 1 for move in1 to in3
130 ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
131 ! parameter 9 1 for load ks3 and ks2 to in4 and in3
136 ! $1 $2 $4 $3 $5 $6 $7 $8 $9
138 ld [out2+256], local1
141 xor local4, $1, local4
142 ifelse($7,1,{mov in1, in3},{nop})
144 ld [out2+260], local2
145 and local4, local1, local4
146 ifelse($8,1,{mov in3, in4},{})
147 ifelse($8,2,{mov in4, in3},{})
149 ld [out2+280], out4 ! loop counter
150 sll local4, 4, local1
153 ld [out2+264], local3
157 ifelse($9,1,{LDPTR KS3, in4},{})
158 xor local4, $2, local4
159 nop !sethi %hi(DES_SPtrans), global1 ! sbox addr
161 ifelse($9,1,{LDPTR KS2, in3},{})
162 and local4, local2, local4
163 nop !or global1, %lo(DES_SPtrans), global1 ! sbox addr
165 sll local4, 16, local1
171 sethi %hi(16711680), local5
172 xor local4, $1, local4
174 and local4, local3, local4
175 or local5, 255, local5
177 sll local4, 2, local2
183 xor local4, $2, local4
184 add global1, 768, global4
186 and local4, local5, local4
187 add global1, 1024, global5
189 ld [out2+272], local7
190 sll local4, 8, local1
196 ld [$5], out0 ! key 7531
197 xor local4, $1, local4
198 add global1, 256, global2
200 ld [$5+4], out1 ! key 8642
201 and local4, local7, local4
202 add global1, 512, global3
204 sll local4, 1, local1
211 add global1, 1280, local6 ! address sbox 8
214 add global1, 1792, out3 ! address sbox 8
217 or local4, local3, $4
219 or local2, local1, $3
223 ld [out2+284], local5 ! 0x0000FC00 used in the rounds
224 or local2, local1, $3
228 and local1, 252, local1
234 ld [out2+284], local5 ! 0x0000FC00 used in the rounds
235 or local2, local1, $3
239 and local1, 252, local1
247 ! The logic used in the DES rounds is the same as in the C code,
248 ! except that calculations for sbox 1 and sbox 5 begin before
249 ! the previous round is finished.
251 ! In each round one half (work) is modified based on key and the
254 ! In this version we do two rounds in a loop repeated 7 times
255 ! and two rounds separately.
257 ! One half has the bits for the sboxes in the following positions:
259 ! 777777xx555555xx333333xx111111xx
261 ! 88xx666666xx444444xx222222xx8888
263 ! The bits for each sbox are xor-ed with the key bits for that box.
264 ! The above xx bits are cleared, and the result used for lookup in
265 ! the sbox table. Each sbox entry contains the 4 output bits permuted
266 ! into 32 bits according to the P permutation.
268 ! In the description of DES, left and right are switched after
269 ! each round, except after last round. In this code the original
270 ! left and right are kept in the same register in all rounds, meaning
271 ! that after the 16 rounds the result for right is in the register
272 ! originally used for left.
274 ! parameter 1 first work (left in first round)
275 ! parameter 2 first use (right in first round)
276 ! parameter 3 enc/dec 1/-1
277 ! parameter 4 loop label
278 ! parameter 5 key address register
279 ! parameter 6 optional address for key next encryption/decryption
280 ! parameter 7 not empty for include retl
282 ! also compares in2 to 8
284 define(rounds_macro, {
287 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
291 ld [out2+284], local5 ! 0x0000FC00
293 and local1, 252, local1
298 ! local6 is address sbox 6
299 ! out3 is address sbox 8
300 ! out4 is loop counter
302 ld [global1+local1], local1
303 xor $2, out1, out1 ! 8642
304 xor $2, out0, out0 ! 7531
305 ! fmovs %f0, %f0 ! fxor used for alignment
307 srl out1, 4, local0 ! rotate 4 right
308 and out0, local5, local3 ! 3
311 ld [$5+$3*8], local7 ! key 7531 next round
312 srl local3, 8, local3 ! 3
313 and local0, 252, local2 ! 2
316 ld [global3+local3],local3 ! 3
317 sll out1, 28, out1 ! rotate
318 xor $1, local1, $1 ! 1 finished, local1 now sbox 7
320 ld [global2+local2], local2 ! 2
321 srl out0, 24, local1 ! 7
322 or out1, local0, out1 ! rotate
324 ldub [out2+local1], local1 ! 7 (and 0xFC)
325 srl out1, 24, local0 ! 8
326 and out1, local5, local4 ! 4
328 ldub [out2+local0], local0 ! 8 (and 0xFC)
329 srl local4, 8, local4 ! 4
330 xor $1, local2, $1 ! 2 finished local2 now sbox 6
332 ld [global4+local4],local4 ! 4
333 srl out1, 16, local2 ! 6
334 xor $1, local3, $1 ! 3 finished local3 now sbox 5
336 ld [out3+local0],local0 ! 8
337 and local2, 252, local2 ! 6
338 add global1, 1536, local5 ! address sbox 7
340 ld [local6+local2], local2 ! 6
341 srl out0, 16, local3 ! 5
342 xor $1, local4, $1 ! 4 finished
344 ld [local5+local1],local1 ! 7
345 and local3, 252, local3 ! 5
346 xor $1, local0, $1 ! 8 finished
348 ld [global5+local3],local3 ! 5
349 xor $1, local2, $1 ! 6 finished
352 ld [$5+$3*8+4], out0 ! key 8642 next round
353 xor $1, local7, local2 ! sbox 5 next round
354 xor $1, local1, $1 ! 7 finished
356 srl local2, 16, local2 ! sbox 5 next round
357 xor $1, local3, $1 ! 5 finished
359 ld [$5+$3*16+4], out1 ! key 8642 next round again
360 and local2, 252, local2 ! sbox5 next round
362 xor $1, local7, local7 ! 7531
364 ld [global5+local2], local2 ! 5
365 srl local7, 24, local3 ! 7
366 xor $1, out0, out0 ! 8642
368 ldub [out2+local3], local3 ! 7 (and 0xFC)
369 srl out0, 4, local0 ! rotate 4 right
370 and local7, 252, local1 ! 1
372 sll out0, 28, out0 ! rotate
373 xor $2, local2, $2 ! 5 finished local2 used
375 srl local0, 8, local4 ! 4
376 and local0, 252, local2 ! 2
377 ld [local5+local3], local3 ! 7
379 srl local0, 16, local5 ! 6
380 or out0, local0, out0 ! rotate
381 ld [global2+local2], local2 ! 2
384 ld [$5+$3*16], out0 ! key 7531 next round
385 and local4, 252, local4 ! 4
387 and local5, 252, local5 ! 6
388 ld [global4+local4], local4 ! 4
389 xor $2, local3, $2 ! 7 finished local3 used
391 and local0, 252, local0 ! 8
392 ld [local6+local5], local5 ! 6
393 xor $2, local2, $2 ! 2 finished local2 now sbox 3
395 srl local7, 8, local2 ! 3 start
396 ld [out3+local0], local0 ! 8
397 xor $2, local4, $2 ! 4 finished
399 and local2, 252, local2 ! 3
400 ld [global1+local1], local1 ! 1
401 xor $2, local5, $2 ! 6 finished local5 used
403 ld [global3+local2], local2 ! 3
404 xor $2, local0, $2 ! 8 finished
405 add $5, $3*16, $5 ! enc add 8, dec add -8 to key pointer
407 ld [out2+284], local5 ! 0x0000FC00
408 xor $2, out0, local4 ! sbox 1 next round
409 xor $2, local1, $2 ! 1 finished
411 xor $2, local2, $2 ! 3 finished
413 and local4, 252, local1 ! sbox 1 next round
417 ld [global1+local1], local1
421 srl out1, 4, local0 ! rotate
422 and out0, local5, local3
424 ld [$5+$3*8], local7 ! key 7531
425 srl local3, 8, local3
426 and local0, 252, local2
428 ld [global3+local3],local3
429 sll out1, 28, out1 ! rotate
430 xor $1, local1, $1 ! 1 finished, local1 now sbox 7
432 ld [global2+local2], local2
434 or out1, local0, out1 ! rotate
436 ldub [out2+local1], local1
438 and out1, local5, local4
440 ldub [out2+local0], local0
441 srl local4, 8, local4
442 xor $1, local2, $1 ! 2 finished local2 now sbox 6
444 ld [global4+local4],local4
446 xor $1, local3, $1 ! 3 finished local3 now sbox 5
448 ld [out3+local0],local0
449 and local2, 252, local2
450 add global1, 1536, local5 ! address sbox 7
452 ld [local6+local2], local2
454 xor $1, local4, $1 ! 4 finished
456 ld [local5+local1],local1
457 and local3, 252, local3
460 ld [global5+local3],local3
461 xor $1, local2, $1 ! 6 finished
464 ifelse($6,{}, {}, {ld [out2+280], out4}) ! loop counter
465 xor $1, local7, local2 ! sbox 5 next round
466 xor $1, local1, $1 ! 7 finished
469 srl local2, 16, local2 ! sbox 5 next round
470 xor $1, local3, $1 ! 5 finished
472 and local2, 252, local2
473 ! next round (two rounds more)
474 xor $1, local7, local7 ! 7531
476 ld [global5+local2], local2
477 srl local7, 24, local3
478 xor $1, out0, out0 ! 8642
480 ldub [out2+local3], local3
481 srl out0, 4, local0 ! rotate
482 and local7, 252, local1
484 sll out0, 28, out0 ! rotate
485 xor $2, local2, $2 ! 5 finished local2 used
487 srl local0, 8, local4
488 and local0, 252, local2
489 ld [local5+local3], local3
491 srl local0, 16, local5
492 or out0, local0, out0 ! rotate
493 ld [global2+local2], local2
496 ifelse($6,{}, {}, {ld [$6], out0}) ! key next encryption/decryption
497 and local4, 252, local4
499 and local5, 252, local5
500 ld [global4+local4], local4
501 xor $2, local3, $2 ! 7 finished local3 used
503 and local0, 252, local0
504 ld [local6+local5], local5
505 xor $2, local2, $2 ! 2 finished local2 now sbox 3
507 srl local7, 8, local2 ! 3 start
508 ld [out3+local0], local0
511 and local2, 252, local2
512 ld [global1+local1], local1
513 xor $2, local5, $2 ! 6 finished local5 used
515 ld [global3+local2], local2
519 ifelse($6,{}, {}, {ld [$6+4], out1}) ! key next encryption/decryption
523 ifelse($7,{}, {}, {retl})
530 ! parameter 1 right (original left)
531 ! parameter 2 left (original right)
532 ! parameter 3 1 for optional store to [in0]
533 ! parameter 4 1 for load input/output address to local5/7
535 ! The final permutation logic switches the halfes, meaning that
536 ! left and right ends up the the registers originally used.
541 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
543 ! initially undo the rotate 3 left done after initial permutation
544 ! original left is received shifted 3 right and 29 left in local3/4
547 or local3, local4, $1
550 sethi %hi(0x55555555), local2
553 or local2, %lo(0x55555555), local2
556 sethi %hi(0x00ff00ff), local1
557 xor local3, $1, local3
558 or local1, %lo(0x00ff00ff), local1
559 and local3, local2, local3
560 sethi %hi(0x33333333), local4
561 sll local3, 1, local2
567 xor local3, $2, local3
568 or local4, %lo(0x33333333), local4
569 and local3, local1, local3
570 sethi %hi(0x0000ffff), local1
571 sll local3, 8, local2
577 xor local3, $1, local3
578 or local1, %lo(0x0000ffff), local1
579 and local3, local4, local3
580 sethi %hi(0x0f0f0f0f), local4
581 sll local3, 2, local2
583 ifelse($4,1, {LDPTR INPUT, local5})
586 ifelse($4,1, {LDPTR OUTPUT, local7})
589 xor local3, $2, local3
590 or local4, %lo(0x0f0f0f0f), local4
591 and local3, local1, local3
592 sll local3, 16, local2
594 xor $2, local3, local1
596 srl local1, 4, local3
598 xor local3, $1, local3
599 and local3, local4, local3
600 sll local3, 4, local2
606 ifelse($3,1, {st $1, [in0]})
608 xor local1, local2, $2
610 ifelse($3,1, {st $2, [in0+4]})
617 ! Does initial permutation for next block mixed with
618 ! final permutation for current block.
620 ! parameter 1 original left
621 ! parameter 2 original right
622 ! parameter 3 left ip
623 ! parameter 4 right ip
624 ! parameter 5 1: load ks1/ks2 to in3/in4, add 120 to in4
627 ! also adds -8 to length in2 and loads loop counter to out4
629 define(fp_ip_macro, {
632 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
634 define({temp1},{out4})
635 define({temp2},{local3})
637 define({ip1},{local1})
638 define({ip2},{local2})
639 define({ip4},{local4})
640 define({ip5},{local5})
642 ! $1 in local3, local4
646 or local3, local4, $1
649 ifelse($5,2,{mov in4, in3})
658 and temp1, ip5, temp1
659 xor local0, $3, local0
664 and local0, ip1, local0
667 sll local0, 4, local7
677 xor local0, $4, local0
678 and temp1, ip4, temp1
679 and local0, ip2, local0
682 sll local0, 16, local7
688 ld [out2+264], temp2 ! ip3
692 xor local0, $3, local0
693 and temp1, temp2, temp1
694 and local0, temp2, local0
697 sll local0, 2, local7
705 xor local0, $4, local0
706 and temp1, ip2, temp1
707 and local0, ip4, local0
709 xor $2, temp1, local4
710 sll local0, 8, local7
717 xor local0, $3, local0
720 and local0, ip5, local0
722 sll local0, 1, local7
729 and temp1, ip1, temp1
734 ifelse($5,1,{LDPTR KS2, in4})
736 xor local4, temp2, $2
738 ! reload since used as temporar:
740 ld [out2+280], out4 ! loop counter
743 ifelse($5,1,{add in4, 120, in4})
745 ifelse($5,1,{LDPTR KS1, in3})
748 or local0, local5, $4
749 or local2, local7, $3
755 ! {load_little_endian}
757 ! parameter 1 address
758 ! parameter 2 destination left
759 ! parameter 3 destination right
760 ! parameter 4 temporar
763 define(load_little_endian, {
765 ! {load_little_endian}
766 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
768 ! first in memory to rightmost in register
804 ! {load_little_endian_inc}
806 ! parameter 1 address
807 ! parameter 2 destination left
808 ! parameter 3 destination right
809 ! parameter 4 temporar
814 define(load_little_endian_inc, {
816 ! {load_little_endian_inc}
817 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
819 ! first in memory to rightmost in register
857 ! Loads 1 to 7 bytes little endian
858 ! Remaining bytes are zeroed.
860 ! parameter 1 address
862 ! parameter 3 destination register left
863 ! parameter 4 destination register right
867 ! parameter 8 return label
869 define(load_n_bytes, {
872 ! $1 $2 $5 $6 $7 $8 $7 $8 $9
877 add %o7,$7.jmp.table-$7.0,$5
929 ! {store_little_endian}
931 ! parameter 1 address
932 ! parameter 2 source left
933 ! parameter 3 source right
934 ! parameter 4 temporar
936 define(store_little_endian, {
938 ! {store_little_endian}
939 ! $1 $2 $3 $4 $5 $6 $7 $8 $9
941 ! rightmost in register to first in memory
980 ! Stores 1 to 7 bytes little endian
982 ! parameter 1 address
984 ! parameter 3 source register left
985 ! parameter 4 source register right
989 ! parameter 8 return label
991 define(store_n_bytes, {
994 ! $1 $2 $5 $6 $7 $8 $7 $8 $9
999 add %o7,$7.jmp.table-$7.0,$5
1052 define(testvalue,{1})
1054 define(register_init, {
1056 ! For test purposes:
1058 sethi %hi(testvalue), local0
1059 or local0, %lo(testvalue), local0
1061 ifelse($1,{},{}, {mov local0, $1})
1062 ifelse($2,{},{}, {mov local0, $2})
1063 ifelse($3,{},{}, {mov local0, $3})
1064 ifelse($4,{},{}, {mov local0, $4})
1065 ifelse($5,{},{}, {mov local0, $5})
1066 ifelse($6,{},{}, {mov local0, $6})
1067 ifelse($7,{},{}, {mov local0, $7})
1068 ifelse($8,{},{}, {mov local0, $8})
1098 ! loads key next encryption/decryption first round from [in4]
1100 rounds_macro(in5, out5, 1, .des_enc.1, in3, in4, retl)
1107 ! implemented with out5 as first parameter to avoid
1108 ! register exchange in ede modes
1111 ! loads key next encryption/decryption first round from [in3]
1113 rounds_macro(out5, in5, -1, .des_dec.1, in4, in3, retl)
1117 ! void DES_encrypt1(data, ks, enc)
1118 ! *******************************
1121 .global DES_encrypt1
1122 .type DES_encrypt1,#function
1126 save %sp, FRAME, %sp
1128 sethi %hi(.PIC.DES_SPtrans-1f),global1
1129 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1131 add %o7,global1,global1
1132 sub global1,.PIC.DES_SPtrans-.des_and,out2
1134 ld [in0], in5 ! left
1138 ld [in0+4], out5 ! right
1140 ! parameter 6 1/2 for include encryption/decryption
1141 ! parameter 7 1 for move in1 to in3
1142 ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
1144 ip_macro(in5, out5, in5, out5, in3, 0, 1, 1)
1146 rounds_macro(in5, out5, 1, .des_encrypt1.1, in3, in4) ! in4 not used
1148 fp_macro(in5, out5, 1) ! 1 for store to [in0]
1155 add in1, 120, in3 ! use last subkey for first round
1157 ! parameter 6 1/2 for include encryption/decryption
1158 ! parameter 7 1 for move in1 to in3
1159 ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
1161 ip_macro(in5, out5, out5, in5, in4, 2, 0, 1) ! include dec, ks in4
1163 fp_macro(out5, in5, 1) ! 1 for store to [in0]
1169 .size DES_encrypt1,.DES_encrypt1.end-DES_encrypt1
1172 ! void DES_encrypt2(data, ks, enc)
1173 !*********************************
1175 ! encrypts/decrypts without initial/final permutation
1178 .global DES_encrypt2
1179 .type DES_encrypt2,#function
1183 save %sp, FRAME, %sp
1185 sethi %hi(.PIC.DES_SPtrans-1f),global1
1186 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1188 add %o7,global1,global1
1189 sub global1,.PIC.DES_SPtrans-.des_and,out2
1191 ! Set sbox address 1 to 6 and rotate halfs 3 left
1192 ! Errors caught by destest? Yes. Still? *NO*
1194 !sethi %hi(DES_SPtrans), global1 ! address sbox 1
1196 !or global1, %lo(DES_SPtrans), global1 ! sbox 1
1198 add global1, 256, global2 ! sbox 2
1199 add global1, 512, global3 ! sbox 3
1201 ld [in0], out5 ! right
1202 add global1, 768, global4 ! sbox 4
1203 add global1, 1024, global5 ! sbox 5
1205 ld [in0+4], in5 ! left
1206 add global1, 1280, local6 ! sbox 6
1207 add global1, 1792, out3 ! sbox 8
1212 mov in1, in3 ! key address to in3
1218 add in5, local5, in5
1220 add out5, local7, out5
1223 ! we use our own stackframe
1226 STPTR in0, [%sp+BIAS+ARG0+0*ARGSZ]
1228 ld [in3], out0 ! key 7531 first round
1229 mov LOOPS, out4 ! loop counter
1231 ld [in3+4], out1 ! key 8642 first round
1232 sethi %hi(0x0000FC00), local5
1243 LDPTR [%sp+BIAS+ARG0+0*ARGSZ], in0
1256 ld [in4], out0 ! key 7531 first round
1257 mov LOOPS, out4 ! loop counter
1259 ld [in4+4], out1 ! key 8642 first round
1260 sethi %hi(0x0000FC00), local5
1262 mov in5, local1 ! left expected in out5
1276 LDPTR [%sp+BIAS+ARG0+0*ARGSZ], in0
1285 .size DES_encrypt2, .DES_encrypt2.end-DES_encrypt2
1288 ! void DES_encrypt3(data, ks1, ks2, ks3)
1289 ! **************************************
1292 .global DES_encrypt3
1293 .type DES_encrypt3,#function
1297 save %sp, FRAME, %sp
1299 sethi %hi(.PIC.DES_SPtrans-1f),global1
1300 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1302 add %o7,global1,global1
1303 sub global1,.PIC.DES_SPtrans-.des_and,out2
1305 ld [in0], in5 ! left
1306 add in2, 120, in4 ! ks2
1308 ld [in0+4], out5 ! right
1309 mov in3, in2 ! save ks3
1311 ! parameter 6 1/2 for include encryption/decryption
1312 ! parameter 7 1 for mov in1 to in3
1313 ! parameter 8 1 for mov in3 to in4
1314 ! parameter 9 1 for load ks3 and ks2 to in4 and in3
1316 ip_macro(in5, out5, in5, out5, in3, 1, 1, 0, 0)
1319 mov in2, in3 ! preload ks3
1324 fp_macro(in5, out5, 1)
1330 .size DES_encrypt3,.DES_encrypt3.end-DES_encrypt3
1333 ! void DES_decrypt3(data, ks1, ks2, ks3)
1334 ! **************************************
1337 .global DES_decrypt3
1338 .type DES_decrypt3,#function
1342 save %sp, FRAME, %sp
1344 sethi %hi(.PIC.DES_SPtrans-1f),global1
1345 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1347 add %o7,global1,global1
1348 sub global1,.PIC.DES_SPtrans-.des_and,out2
1350 ld [in0], in5 ! left
1351 add in3, 120, in4 ! ks3
1353 ld [in0+4], out5 ! right
1356 ! parameter 6 1/2 for include encryption/decryption
1357 ! parameter 7 1 for mov in1 to in3
1358 ! parameter 8 1 for mov in3 to in4
1359 ! parameter 9 1 for load ks3 and ks2 to in4 and in3
1361 ip_macro(in5, out5, out5, in5, in4, 2, 0, 0, 0)
1364 add in1, 120, in4 ! preload ks1
1369 fp_macro(out5, in5, 1)
1375 .size DES_decrypt3,.DES_decrypt3.end-DES_decrypt3
1377 ! void DES_ncbc_encrypt(input, output, length, schedule, ivec, enc)
1378 ! *****************************************************************
1382 .global DES_ncbc_encrypt
1383 .type DES_ncbc_encrypt,#function
1387 save %sp, FRAME, %sp
1389 define({INPUT}, { [%sp+BIAS+ARG0+0*ARGSZ] })
1390 define({OUTPUT}, { [%sp+BIAS+ARG0+1*ARGSZ] })
1391 define({IVEC}, { [%sp+BIAS+ARG0+4*ARGSZ] })
1393 sethi %hi(.PIC.DES_SPtrans-1f),global1
1394 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1396 add %o7,global1,global1
1397 sub global1,.PIC.DES_SPtrans-.des_and,out2
1404 ! addr left right temp label
1405 load_little_endian(in4, in5, out5, local3, .LLE1) ! iv
1407 addcc in2, -8, in2 ! bytes missing when first block done
1409 bl .ncbc.enc.seven.or.less
1410 mov in3, in4 ! schedule
1412 .ncbc.enc.next.block:
1414 load_little_endian(in0, out4, global4, local3, .LLE2) ! block
1416 .ncbc.enc.next.block_1:
1418 xor in5, out4, in5 ! iv xor
1419 xor out5, global4, out5 ! iv xor
1421 ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
1422 ip_macro(in5, out5, in5, out5, in3, 0, 0, 2)
1424 .ncbc.enc.next.block_2:
1426 !// call .des_enc ! compares in2 to 8
1427 ! rounds inlined for alignment purposes
1429 add global1, 768, global4 ! address sbox 4 since register used below
1431 rounds_macro(in5, out5, 1, .ncbc.enc.1, in3, in4) ! include encryption ks in3
1433 bl .ncbc.enc.next.block_fp
1434 add in0, 8, in0 ! input address
1436 ! If 8 or more bytes are to be encrypted after this block,
1437 ! we combine final permutation for this block with initial
1438 ! permutation for next block. Load next block:
1440 load_little_endian(in0, global3, global4, local5, .LLE12)
1442 ! parameter 1 original left
1443 ! parameter 2 original right
1444 ! parameter 3 left ip
1445 ! parameter 4 right ip
1446 ! parameter 5 1: load ks1/ks2 to in3/in4, add 120 to in4
1449 ! also adds -8 to length in2 and loads loop counter to out4
1451 fp_ip_macro(out0, out1, global3, global4, 2)
1453 store_little_endian(in1, out0, out1, local3, .SLE10) ! block
1455 ld [in3], out0 ! key 7531 first round next block
1457 xor global3, out5, in5 ! iv xor next block
1459 ld [in3+4], out1 ! key 8642
1460 add global1, 512, global3 ! address sbox 3 since register used
1461 xor global4, local1, out5 ! iv xor next block
1463 ba .ncbc.enc.next.block_2
1464 add in1, 8, in1 ! output address
1466 .ncbc.enc.next.block_fp:
1470 store_little_endian(in1, in5, out5, local3, .SLE1) ! block
1472 addcc in2, -8, in2 ! bytes missing when next block done
1474 bpos .ncbc.enc.next.block
1477 .ncbc.enc.seven.or.less:
1481 ble .ncbc.enc.finish
1484 add in2, 8, local1 ! bytes to load
1486 ! addr, length, dest left, dest right, temp, temp2, label, ret label
1487 load_n_bytes(in0, local1, global4, out4, local2, local3, .LNB1, .ncbc.enc.next.block_1)
1489 ! Loads 1 to 7 bytes little endian to global4, out4
1495 store_little_endian(local4, in5, out5, local5, .SLE2) ! ivec
1507 LDPTR IVEC, local7 ! ivec
1508 ble .ncbc.dec.finish
1509 mov in3, in4 ! schedule
1512 mov in0, local5 ! input
1514 load_little_endian(local7, in0, in1, local3, .LLE3) ! ivec
1516 .ncbc.dec.next.block:
1518 load_little_endian(local5, in5, out5, local3, .LLE4) ! block
1520 ! parameter 6 1/2 for include encryption/decryption
1521 ! parameter 7 1 for mov in1 to in3
1522 ! parameter 8 1 for mov in3 to in4
1524 ip_macro(in5, out5, out5, in5, in4, 2, 0, 1) ! include decryprion ks in4
1526 fp_macro(out5, in5, 0, 1) ! 1 for input and output address to local5/7
1528 ! in2 is bytes left to be stored
1529 ! in2 is compared to 8 in the rounds
1531 xor out5, in0, out4 ! iv xor
1532 bl .ncbc.dec.seven.or.less
1533 xor in5, in1, global4 ! iv xor
1535 ! Load ivec next block now, since input and output address might be the same.
1537 load_little_endian_inc(local5, in0, in1, local3, .LLE5) ! iv
1539 store_little_endian(local7, out4, global4, local3, .SLE3)
1542 add local7, 8, local7
1545 bg .ncbc.dec.next.block
1546 STPTR local7, OUTPUT
1551 LDPTR IVEC, local4 ! ivec
1552 store_little_endian(local4, in0, in1, local5, .SLE4)
1559 .ncbc.dec.seven.or.less:
1561 load_little_endian_inc(local5, in0, in1, local3, .LLE13) ! ivec
1563 store_n_bytes(local7, in2, global4, out4, local3, local4, .SNB1, .ncbc.dec.store.iv)
1566 .DES_ncbc_encrypt.end:
1567 .size DES_ncbc_encrypt, .DES_ncbc_encrypt.end-DES_ncbc_encrypt
1570 ! void DES_ede3_cbc_encrypt(input, output, lenght, ks1, ks2, ks3, ivec, enc)
1571 ! **************************************************************************
1575 .global DES_ede3_cbc_encrypt
1576 .type DES_ede3_cbc_encrypt,#function
1578 DES_ede3_cbc_encrypt:
1580 save %sp, FRAME, %sp
1582 define({KS1}, { [%sp+BIAS+ARG0+3*ARGSZ] })
1583 define({KS2}, { [%sp+BIAS+ARG0+4*ARGSZ] })
1584 define({KS3}, { [%sp+BIAS+ARG0+5*ARGSZ] })
1586 sethi %hi(.PIC.DES_SPtrans-1f),global1
1587 or global1,%lo(.PIC.DES_SPtrans-1f),global1
1589 add %o7,global1,global1
1590 sub global1,.PIC.DES_SPtrans-.des_and,out2
1592 LDPTR [%fp+BIAS+ARG0+7*ARGSZ], local3 ! enc
1593 LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local4 ! ivec
1601 load_little_endian(local4, in5, out5, local3, .LLE6) ! ivec
1603 addcc in2, -8, in2 ! bytes missing after next block
1605 bl .ede3.enc.seven.or.less
1608 .ede3.enc.next.block:
1610 load_little_endian(in0, out4, global4, local3, .LLE7)
1612 .ede3.enc.next.block_1:
1615 xor in5, out4, in5 ! iv xor
1616 xor out5, global4, out5 ! iv xor
1619 add in4, 120, in4 ! for decryption we use last subkey first
1622 ip_macro(in5, out5, in5, out5, in3)
1624 .ede3.enc.next.block_2:
1626 call .des_enc ! ks1 in3
1629 call .des_dec ! ks2 in4
1632 call .des_enc ! ks3 in3 compares in2 to 8
1635 bl .ede3.enc.next.block_fp
1638 ! If 8 or more bytes are to be encrypted after this block,
1639 ! we combine final permutation for this block with initial
1640 ! permutation for next block. Load next block:
1642 load_little_endian(in0, global3, global4, local5, .LLE11)
1644 ! parameter 1 original left
1645 ! parameter 2 original right
1646 ! parameter 3 left ip
1647 ! parameter 4 right ip
1648 ! parameter 5 1: load ks1/ks2 to in3/in4, add 120 to in4
1651 ! also adds -8 to length in2 and loads loop counter to out4
1653 fp_ip_macro(out0, out1, global3, global4, 1)
1655 store_little_endian(in1, out0, out1, local3, .SLE9) ! block
1658 xor global3, out5, in5 ! iv xor next block
1660 ld [in3], out0 ! key 7531
1661 add global1, 512, global3 ! address sbox 3
1662 xor global4, local1, out5 ! iv xor next block
1664 ld [in3+4], out1 ! key 8642
1665 add global1, 768, global4 ! address sbox 4
1666 ba .ede3.enc.next.block_2
1669 .ede3.enc.next.block_fp:
1673 store_little_endian(in1, in5, out5, local3, .SLE5) ! block
1675 addcc in2, -8, in2 ! bytes missing when next block done
1677 bpos .ede3.enc.next.block
1680 .ede3.enc.seven.or.less:
1684 ble .ede3.enc.finish
1687 add in2, 8, local1 ! bytes to load
1689 ! addr, length, dest left, dest right, temp, temp2, label, ret label
1690 load_n_bytes(in0, local1, global4, out4, local2, local3, .LNB2, .ede3.enc.next.block_1)
1694 LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local4 ! ivec
1695 store_little_endian(local4, in5, out5, local5, .SLE6) ! ivec
1712 ble .ede3.dec.finish
1715 LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local7 ! iv
1716 load_little_endian(local7, in0, in1, local3, .LLE8)
1718 .ede3.dec.next.block:
1720 load_little_endian(local5, in5, out5, local3, .LLE9)
1722 ! parameter 6 1/2 for include encryption/decryption
1723 ! parameter 7 1 for mov in1 to in3
1724 ! parameter 8 1 for mov in3 to in4
1725 ! parameter 9 1 for load ks3 and ks2 to in4 and in3
1727 ip_macro(in5, out5, out5, in5, in4, 2, 0, 0, 1) ! inc .des_dec ks3 in4
1729 call .des_enc ! ks2 in3
1732 call .des_dec ! ks1 in4
1735 fp_macro(out5, in5, 0, 1) ! 1 for input and output address local5/7
1737 ! in2 is bytes left to be stored
1738 ! in2 is compared to 8 in the rounds
1741 bl .ede3.dec.seven.or.less
1742 xor in5, in1, global4
1744 load_little_endian_inc(local5, in0, in1, local3, .LLE10) ! iv next block
1746 store_little_endian(local7, out4, global4, local3, .SLE7) ! block
1750 add local7, 8, local7
1752 bg .ede3.dec.next.block
1753 STPTR local7, OUTPUT
1757 LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local4 ! ivec
1758 store_little_endian(local4, in0, in1, local5, .SLE8) ! ivec
1765 .ede3.dec.seven.or.less:
1767 load_little_endian_inc(local5, in0, in1, local3, .LLE14) ! iv
1769 store_n_bytes(local7, in2, global4, out4, local3, local4, .SNB2, .ede3.dec.store.iv)
1772 .DES_ede3_cbc_encrypt.end:
1773 .size DES_ede3_cbc_encrypt,.DES_ede3_cbc_encrypt.end-DES_ede3_cbc_encrypt
1776 .type .des_and,#object
1781 ! This table is used for AND 0xFC when it is known that register
1782 ! bits 8-31 are zero. Makes it possible to do three arithmetic
1783 ! operations in one cycle.
1785 .byte 0, 0, 0, 0, 4, 4, 4, 4
1786 .byte 8, 8, 8, 8, 12, 12, 12, 12
1787 .byte 16, 16, 16, 16, 20, 20, 20, 20
1788 .byte 24, 24, 24, 24, 28, 28, 28, 28
1789 .byte 32, 32, 32, 32, 36, 36, 36, 36
1790 .byte 40, 40, 40, 40, 44, 44, 44, 44
1791 .byte 48, 48, 48, 48, 52, 52, 52, 52
1792 .byte 56, 56, 56, 56, 60, 60, 60, 60
1793 .byte 64, 64, 64, 64, 68, 68, 68, 68
1794 .byte 72, 72, 72, 72, 76, 76, 76, 76
1795 .byte 80, 80, 80, 80, 84, 84, 84, 84
1796 .byte 88, 88, 88, 88, 92, 92, 92, 92
1797 .byte 96, 96, 96, 96, 100, 100, 100, 100
1798 .byte 104, 104, 104, 104, 108, 108, 108, 108
1799 .byte 112, 112, 112, 112, 116, 116, 116, 116
1800 .byte 120, 120, 120, 120, 124, 124, 124, 124
1801 .byte 128, 128, 128, 128, 132, 132, 132, 132
1802 .byte 136, 136, 136, 136, 140, 140, 140, 140
1803 .byte 144, 144, 144, 144, 148, 148, 148, 148
1804 .byte 152, 152, 152, 152, 156, 156, 156, 156
1805 .byte 160, 160, 160, 160, 164, 164, 164, 164
1806 .byte 168, 168, 168, 168, 172, 172, 172, 172
1807 .byte 176, 176, 176, 176, 180, 180, 180, 180
1808 .byte 184, 184, 184, 184, 188, 188, 188, 188
1809 .byte 192, 192, 192, 192, 196, 196, 196, 196
1810 .byte 200, 200, 200, 200, 204, 204, 204, 204
1811 .byte 208, 208, 208, 208, 212, 212, 212, 212
1812 .byte 216, 216, 216, 216, 220, 220, 220, 220
1813 .byte 224, 224, 224, 224, 228, 228, 228, 228
1814 .byte 232, 232, 232, 232, 236, 236, 236, 236
1815 .byte 240, 240, 240, 240, 244, 244, 244, 244
1816 .byte 248, 248, 248, 248, 252, 252, 252, 252
1818 ! 5 numbers for initil/final permutation
1820 .word 0x0f0f0f0f ! offset 256
1821 .word 0x0000ffff ! 260
1822 .word 0x33333333 ! 264
1823 .word 0x00ff00ff ! 268
1824 .word 0x55555555 ! 272
1828 .word 0x0000FC00 ! 284
1831 .type DES_SPtrans,#object
1832 .size DES_SPtrans,2048
1837 .word 0x02080800, 0x00080000, 0x02000002, 0x02080802
1838 .word 0x02000000, 0x00080802, 0x00080002, 0x02000002
1839 .word 0x00080802, 0x02080800, 0x02080000, 0x00000802
1840 .word 0x02000802, 0x02000000, 0x00000000, 0x00080002
1841 .word 0x00080000, 0x00000002, 0x02000800, 0x00080800
1842 .word 0x02080802, 0x02080000, 0x00000802, 0x02000800
1843 .word 0x00000002, 0x00000800, 0x00080800, 0x02080002
1844 .word 0x00000800, 0x02000802, 0x02080002, 0x00000000
1845 .word 0x00000000, 0x02080802, 0x02000800, 0x00080002
1846 .word 0x02080800, 0x00080000, 0x00000802, 0x02000800
1847 .word 0x02080002, 0x00000800, 0x00080800, 0x02000002
1848 .word 0x00080802, 0x00000002, 0x02000002, 0x02080000
1849 .word 0x02080802, 0x00080800, 0x02080000, 0x02000802
1850 .word 0x02000000, 0x00000802, 0x00080002, 0x00000000
1851 .word 0x00080000, 0x02000000, 0x02000802, 0x02080800
1852 .word 0x00000002, 0x02080002, 0x00000800, 0x00080802
1854 .word 0x40108010, 0x00000000, 0x00108000, 0x40100000
1855 .word 0x40000010, 0x00008010, 0x40008000, 0x00108000
1856 .word 0x00008000, 0x40100010, 0x00000010, 0x40008000
1857 .word 0x00100010, 0x40108000, 0x40100000, 0x00000010
1858 .word 0x00100000, 0x40008010, 0x40100010, 0x00008000
1859 .word 0x00108010, 0x40000000, 0x00000000, 0x00100010
1860 .word 0x40008010, 0x00108010, 0x40108000, 0x40000010
1861 .word 0x40000000, 0x00100000, 0x00008010, 0x40108010
1862 .word 0x00100010, 0x40108000, 0x40008000, 0x00108010
1863 .word 0x40108010, 0x00100010, 0x40000010, 0x00000000
1864 .word 0x40000000, 0x00008010, 0x00100000, 0x40100010
1865 .word 0x00008000, 0x40000000, 0x00108010, 0x40008010
1866 .word 0x40108000, 0x00008000, 0x00000000, 0x40000010
1867 .word 0x00000010, 0x40108010, 0x00108000, 0x40100000
1868 .word 0x40100010, 0x00100000, 0x00008010, 0x40008000
1869 .word 0x40008010, 0x00000010, 0x40100000, 0x00108000
1871 .word 0x04000001, 0x04040100, 0x00000100, 0x04000101
1872 .word 0x00040001, 0x04000000, 0x04000101, 0x00040100
1873 .word 0x04000100, 0x00040000, 0x04040000, 0x00000001
1874 .word 0x04040101, 0x00000101, 0x00000001, 0x04040001
1875 .word 0x00000000, 0x00040001, 0x04040100, 0x00000100
1876 .word 0x00000101, 0x04040101, 0x00040000, 0x04000001
1877 .word 0x04040001, 0x04000100, 0x00040101, 0x04040000
1878 .word 0x00040100, 0x00000000, 0x04000000, 0x00040101
1879 .word 0x04040100, 0x00000100, 0x00000001, 0x00040000
1880 .word 0x00000101, 0x00040001, 0x04040000, 0x04000101
1881 .word 0x00000000, 0x04040100, 0x00040100, 0x04040001
1882 .word 0x00040001, 0x04000000, 0x04040101, 0x00000001
1883 .word 0x00040101, 0x04000001, 0x04000000, 0x04040101
1884 .word 0x00040000, 0x04000100, 0x04000101, 0x00040100
1885 .word 0x04000100, 0x00000000, 0x04040001, 0x00000101
1886 .word 0x04000001, 0x00040101, 0x00000100, 0x04040000
1888 .word 0x00401008, 0x10001000, 0x00000008, 0x10401008
1889 .word 0x00000000, 0x10400000, 0x10001008, 0x00400008
1890 .word 0x10401000, 0x10000008, 0x10000000, 0x00001008
1891 .word 0x10000008, 0x00401008, 0x00400000, 0x10000000
1892 .word 0x10400008, 0x00401000, 0x00001000, 0x00000008
1893 .word 0x00401000, 0x10001008, 0x10400000, 0x00001000
1894 .word 0x00001008, 0x00000000, 0x00400008, 0x10401000
1895 .word 0x10001000, 0x10400008, 0x10401008, 0x00400000
1896 .word 0x10400008, 0x00001008, 0x00400000, 0x10000008
1897 .word 0x00401000, 0x10001000, 0x00000008, 0x10400000
1898 .word 0x10001008, 0x00000000, 0x00001000, 0x00400008
1899 .word 0x00000000, 0x10400008, 0x10401000, 0x00001000
1900 .word 0x10000000, 0x10401008, 0x00401008, 0x00400000
1901 .word 0x10401008, 0x00000008, 0x10001000, 0x00401008
1902 .word 0x00400008, 0x00401000, 0x10400000, 0x10001008
1903 .word 0x00001008, 0x10000000, 0x10000008, 0x10401000
1905 .word 0x08000000, 0x00010000, 0x00000400, 0x08010420
1906 .word 0x08010020, 0x08000400, 0x00010420, 0x08010000
1907 .word 0x00010000, 0x00000020, 0x08000020, 0x00010400
1908 .word 0x08000420, 0x08010020, 0x08010400, 0x00000000
1909 .word 0x00010400, 0x08000000, 0x00010020, 0x00000420
1910 .word 0x08000400, 0x00010420, 0x00000000, 0x08000020
1911 .word 0x00000020, 0x08000420, 0x08010420, 0x00010020
1912 .word 0x08010000, 0x00000400, 0x00000420, 0x08010400
1913 .word 0x08010400, 0x08000420, 0x00010020, 0x08010000
1914 .word 0x00010000, 0x00000020, 0x08000020, 0x08000400
1915 .word 0x08000000, 0x00010400, 0x08010420, 0x00000000
1916 .word 0x00010420, 0x08000000, 0x00000400, 0x00010020
1917 .word 0x08000420, 0x00000400, 0x00000000, 0x08010420
1918 .word 0x08010020, 0x08010400, 0x00000420, 0x00010000
1919 .word 0x00010400, 0x08010020, 0x08000400, 0x00000420
1920 .word 0x00000020, 0x00010420, 0x08010000, 0x08000020
1922 .word 0x80000040, 0x00200040, 0x00000000, 0x80202000
1923 .word 0x00200040, 0x00002000, 0x80002040, 0x00200000
1924 .word 0x00002040, 0x80202040, 0x00202000, 0x80000000
1925 .word 0x80002000, 0x80000040, 0x80200000, 0x00202040
1926 .word 0x00200000, 0x80002040, 0x80200040, 0x00000000
1927 .word 0x00002000, 0x00000040, 0x80202000, 0x80200040
1928 .word 0x80202040, 0x80200000, 0x80000000, 0x00002040
1929 .word 0x00000040, 0x00202000, 0x00202040, 0x80002000
1930 .word 0x00002040, 0x80000000, 0x80002000, 0x00202040
1931 .word 0x80202000, 0x00200040, 0x00000000, 0x80002000
1932 .word 0x80000000, 0x00002000, 0x80200040, 0x00200000
1933 .word 0x00200040, 0x80202040, 0x00202000, 0x00000040
1934 .word 0x80202040, 0x00202000, 0x00200000, 0x80002040
1935 .word 0x80000040, 0x80200000, 0x00202040, 0x00000000
1936 .word 0x00002000, 0x80000040, 0x80002040, 0x80202000
1937 .word 0x80200000, 0x00002040, 0x00000040, 0x80200040
1939 .word 0x00004000, 0x00000200, 0x01000200, 0x01000004
1940 .word 0x01004204, 0x00004004, 0x00004200, 0x00000000
1941 .word 0x01000000, 0x01000204, 0x00000204, 0x01004000
1942 .word 0x00000004, 0x01004200, 0x01004000, 0x00000204
1943 .word 0x01000204, 0x00004000, 0x00004004, 0x01004204
1944 .word 0x00000000, 0x01000200, 0x01000004, 0x00004200
1945 .word 0x01004004, 0x00004204, 0x01004200, 0x00000004
1946 .word 0x00004204, 0x01004004, 0x00000200, 0x01000000
1947 .word 0x00004204, 0x01004000, 0x01004004, 0x00000204
1948 .word 0x00004000, 0x00000200, 0x01000000, 0x01004004
1949 .word 0x01000204, 0x00004204, 0x00004200, 0x00000000
1950 .word 0x00000200, 0x01000004, 0x00000004, 0x01000200
1951 .word 0x00000000, 0x01000204, 0x01000200, 0x00004200
1952 .word 0x00000204, 0x00004000, 0x01004204, 0x01000000
1953 .word 0x01004200, 0x00000004, 0x00004004, 0x01004204
1954 .word 0x01000004, 0x01004200, 0x01004000, 0x00004004
1956 .word 0x20800080, 0x20820000, 0x00020080, 0x00000000
1957 .word 0x20020000, 0x00800080, 0x20800000, 0x20820080
1958 .word 0x00000080, 0x20000000, 0x00820000, 0x00020080
1959 .word 0x00820080, 0x20020080, 0x20000080, 0x20800000
1960 .word 0x00020000, 0x00820080, 0x00800080, 0x20020000
1961 .word 0x20820080, 0x20000080, 0x00000000, 0x00820000
1962 .word 0x20000000, 0x00800000, 0x20020080, 0x20800080
1963 .word 0x00800000, 0x00020000, 0x20820000, 0x00000080
1964 .word 0x00800000, 0x00020000, 0x20000080, 0x20820080
1965 .word 0x00020080, 0x20000000, 0x00000000, 0x00820000
1966 .word 0x20800080, 0x20020080, 0x20020000, 0x00800080
1967 .word 0x20820000, 0x00000080, 0x00800080, 0x20020000
1968 .word 0x20820080, 0x00800000, 0x20800000, 0x20000080
1969 .word 0x00820000, 0x00020080, 0x20020080, 0x20800000
1970 .word 0x00000080, 0x20820000, 0x00820080, 0x00000000
1971 .word 0x20000000, 0x20800080, 0x00020000, 0x00820080