1 C nettle
, low-level cryptographics library
3 C Copyright
(C
) 2004, Niels Möller
5 C The nettle library is free software
; you can redistribute it and/or modify
6 C it under the terms of the GNU Lesser General
Public License as published by
7 C the Free Software Foundation
; either version 2.1 of the License, or (at your
8 C option
) any later version.
10 C The nettle library is distributed
in the hope that it will be useful
, but
11 C WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
12 C
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public
13 C License for more details.
15 C You should have received a copy of the GNU Lesser General
Public License
16 C along with the nettle library
; see the file COPYING.LIB. If not, write to
17 C the Free Software Foundation
, Inc.
, 51 Franklin Street
, Fifth Floor
, Boston
,
31 define
(<K1VALUE
>, <0x5A827999>) C Rounds
0-19
32 define
(<K2VALUE
>, <0x6ED9EBA1>) C Rounds
20-39
33 define
(<K3VALUE
>, <0x8F1BBCDC>) C Rounds
40-59
34 define
(<K4VALUE
>, <0xCA62C1D6>) C Rounds
60-79
36 C Reads the input via T2
into register
, byteswaps it
, and stores it
in the DATA array.
37 C SWAP
(index
, register
)
39 movl
OFFSET($1)(T2
), $2
41 movl
$2, OFFSET($1) (DATA
)
46 C f1
(x
,y
,z
) = z ^
(x
& (y ^ z
))
47 C f2
(x
,y
,z
) = x ^ y ^ z
48 C f3
(x
,y
,z
) = (x
& (y ^ z
)) + (y
& z
)
51 C
This form for f3 was suggested by George Spelvin. The terms can be
52 C added
into the result one at a time
, saving one temporary.
54 C The form of one sha1 round is
56 C a
' = e + a <<< 5 + f( b, c, d ) + k + w;
62 C where <<< denotes rotation. We permute our variables, so that we
65 C e += a <<< 5 + f( b, c, d ) + k + w;
68 dnl ROUND_F1(a, b, c, d, e, i)
70 mov OFFSET(eval($6 % 16)) (DATA), T1
71 xor OFFSET(eval(($6 + 2) % 16)) (DATA), T1
72 xor OFFSET(eval(($6 + 8) % 16)) (DATA), T1
73 xor OFFSET(eval(($6 + 13) % 16)) (DATA), T1
75 mov T1, OFFSET(eval($6 % 16)) (DATA)
81 lea K1VALUE (T1, $5), $5
88 dnl ROUND_F1_NOEXP(a, b, c, d, e, i)
89 define(<ROUND_F1_NOEXP>, <
94 add OFFSET($6) (DATA), $5
99 lea K1VALUE (T1, $5), $5
102 dnl ROUND_F2(a, b, c, d, e, i, k)
104 mov OFFSET(eval($6 % 16)) (DATA), T1
105 xor OFFSET(eval(($6 + 2) % 16)) (DATA), T1
106 xor OFFSET(eval(($6 + 8) % 16)) (DATA), T1
107 xor OFFSET(eval(($6 + 13) % 16)) (DATA), T1
109 mov T1, OFFSET(eval($6 % 16)) (DATA)
121 dnl ROUND_F3(a, b, c, d, e, i)
123 mov OFFSET(eval($6 % 16)) (DATA), T1
124 xor OFFSET(eval(($6 + 2) % 16)) (DATA), T1
125 xor OFFSET(eval(($6 + 8) % 16)) (DATA), T1
126 xor OFFSET(eval(($6 + 13) % 16)) (DATA), T1
128 mov T1, OFFSET(eval($6 % 16)) (DATA)
131 lea K3VALUE (T1, $5), $5
143 .file "sha1-compress.asm"
145 C _nettle_sha1_compress(uint32_t *state, uint8_t *data)
149 PROLOGUE(_nettle_sha1_compress)
150 C save all registers that need to be saved
153 C 80(%esp) Return address
154 pushl %ebx C 76(%esp)
155 pushl %ebp C 72(%esp)
156 pushl %esi C 68(%esp)
157 pushl %edi C 64(%esp)
159 subl $64, %esp C %esp = W
161 C Loop-mixed to 520 cycles (for the complete function call) on
165 mov OFFSET(2)(T2), %ecx
166 mov OFFSET(0)(T2), %eax
169 mov %ecx, OFFSET(2) (DATA)
170 mov %eax, OFFSET(0) (DATA)
171 mov OFFSET(3)(T2), %edx
172 mov OFFSET(6)(T2), %ecx
173 mov OFFSET(4)(T2), %eax
174 mov OFFSET(1)(T2), %ebx
178 mov %ecx, OFFSET(6) (DATA)
179 mov %eax, OFFSET(4) (DATA)
181 mov %edx, OFFSET(3) (DATA)
182 mov %ebx, OFFSET(1) (DATA)
183 mov OFFSET(10)(T2), %ecx
184 mov OFFSET(8)(T2), %eax
185 mov OFFSET(7)(T2), %edx
188 mov %edx, OFFSET(7) (DATA)
189 mov OFFSET(5)(T2), %ebx
190 mov %eax, OFFSET(8) (DATA)
191 mov OFFSET(11)(T2), %edx
194 mov OFFSET(12)(T2), %eax
196 mov %ecx, OFFSET(10) (DATA)
197 mov %ebx, OFFSET(5) (DATA)
198 mov %edx, OFFSET(11) (DATA)
199 mov OFFSET(15)(T2), %edx
201 mov OFFSET(9)(T2), %ebx
205 mov OFFSET(14)(T2), %ecx
206 mov %edx, OFFSET(15) (DATA)
208 mov %ecx, OFFSET(14) (DATA)
209 mov %ebx, OFFSET(9) (DATA)
210 mov OFFSET(13)(T2), %ebx
213 mov %ebx, OFFSET(13) (DATA)
218 add OFFSET(0) (DATA), SE
220 mov %eax, OFFSET(12) (DATA)
228 add OFFSET(1) (DATA), SD
233 lea K1VALUE (T1, SE), SE
240 add OFFSET(2) (DATA), SC
244 lea K1VALUE (T1, SD), SD
250 lea K1VALUE (T1, SC), SC
253 add OFFSET(3) (DATA), SB
262 add OFFSET(4) (DATA), SA
263 lea K1VALUE (T1, SB), SB
271 add OFFSET(5) (DATA), SE
277 lea K1VALUE (T1, SA), SA
279 add OFFSET(6) (DATA), SD
283 lea K1VALUE (T1, SE), SE
291 lea K1VALUE (T1, SD), SD
293 add OFFSET(7) (DATA), SC
295 add OFFSET(8) (DATA), SB
302 lea K1VALUE (T1, SC), SC
310 lea K1VALUE (T1, SB), SB
313 add OFFSET(10) (DATA), SE
314 add OFFSET(9) (DATA), SA
318 lea K1VALUE (T1, SA), SA
329 add OFFSET(11) (DATA), SD
334 lea K1VALUE (T1, SE), SE
341 lea K1VALUE (T1, SD), SD
343 add OFFSET(12) (DATA), SC
351 add OFFSET(13) (DATA), SB
352 lea K1VALUE (T1, SC), SC
362 add OFFSET(14) (DATA), SA
367 lea K1VALUE (T1, SB), SB
371 lea K1VALUE (T1, SA), SA
374 add OFFSET(15) (DATA), SE
377 lea K1VALUE (T1, SE), SE
378 mov OFFSET(0) (DATA), T1
379 xor OFFSET(2) (DATA), T1
381 xor OFFSET(8) (DATA), T1
382 xor OFFSET(13) (DATA), T1
388 lea K1VALUE (T1, T2), T2
389 mov T1, OFFSET(0) (DATA)
393 mov OFFSET(1) (DATA), T1
394 xor OFFSET(3) (DATA), T1
400 xor OFFSET(9) (DATA), T1
401 xor OFFSET(14) (DATA), T1
404 mov T1, OFFSET(1) (DATA)
405 lea K1VALUE (T1, T2), T2
409 mov OFFSET(2) (DATA), T1
410 xor OFFSET(4) (DATA), T1
415 xor OFFSET(10) (DATA), T1
416 xor OFFSET(15) (DATA), T1
420 mov T1, OFFSET(2) (DATA)
421 lea K1VALUE (T1, T2), T2
428 mov OFFSET(3) (DATA), T1
430 xor OFFSET(5) (DATA), T1
433 xor OFFSET(11) (DATA), T1
434 xor OFFSET(0) (DATA), T1
436 mov T1, OFFSET(3) (DATA)
437 lea K1VALUE (T1, T2), T2
441 mov OFFSET(4) (DATA), T1
442 xor OFFSET(6) (DATA), T1
444 xor OFFSET(12) (DATA), T1
446 xor OFFSET(1) (DATA), T1
451 lea K2VALUE (T1, T2), T2
452 mov T1, OFFSET(4) (DATA)
456 mov OFFSET(5) (DATA), T1
459 xor OFFSET(7) (DATA), T1
461 xor OFFSET(13) (DATA), T1
463 xor OFFSET(2) (DATA), T1
466 mov T1, OFFSET(5) (DATA)
467 lea K2VALUE (T1, T2), T2
471 mov OFFSET(6) (DATA), T1
472 xor OFFSET(8) (DATA), T1
475 xor OFFSET(14) (DATA), T1
477 xor OFFSET(3) (DATA), T1
481 lea K2VALUE (T1, T2), T2
482 mov T1, OFFSET(6) (DATA)
489 mov OFFSET(7) (DATA), T1
490 xor OFFSET(9) (DATA), T1
492 xor OFFSET(15) (DATA), T1
493 xor OFFSET(4) (DATA), T1
496 lea K2VALUE (T1, T2), T2
497 mov T1, OFFSET(7) (DATA)
501 mov OFFSET(8) (DATA), T1
502 xor OFFSET(10) (DATA), T1
506 xor OFFSET(0) (DATA), T1
507 xor OFFSET(5) (DATA), T1
511 mov T1, OFFSET(8) (DATA)
512 lea K2VALUE (T1, T2), T2
516 mov OFFSET(9) (DATA), T1
517 xor OFFSET(11) (DATA), T1
518 xor OFFSET(1) (DATA), T1
520 xor OFFSET(6) (DATA), T1
525 mov T1, OFFSET(9) (DATA)
527 lea K2VALUE (T1, T2), T2
531 mov OFFSET(10) (DATA), T1
532 xor OFFSET(12) (DATA), T1
533 xor OFFSET(2) (DATA), T1
537 xor OFFSET(7) (DATA), T1
541 lea K2VALUE (T1, T2), T2
542 mov T1, OFFSET(10) (DATA)
546 mov OFFSET(11) (DATA), T1
547 xor OFFSET(13) (DATA), T1
549 xor OFFSET(3) (DATA), T1
551 xor OFFSET(8) (DATA), T1
555 mov T1, OFFSET(11) (DATA)
557 lea K2VALUE (T1, T2), T2
561 mov OFFSET(12) (DATA), T1
562 xor OFFSET(14) (DATA), T1
565 xor OFFSET(4) (DATA), T1
567 xor OFFSET(9) (DATA), T1
571 mov T1, OFFSET(12) (DATA)
572 lea K2VALUE (T1, T2), T2
577 mov OFFSET(13) (DATA), T1
578 xor OFFSET(15) (DATA), T1
581 xor OFFSET(5) (DATA), T1
583 xor OFFSET(10) (DATA), T1
586 lea K2VALUE (T1, T2), T2
587 mov T1, OFFSET(13) (DATA)
593 mov OFFSET(14) (DATA), T1
594 xor OFFSET(0) (DATA), T1
596 xor OFFSET(6) (DATA), T1
597 xor OFFSET(11) (DATA), T1
601 lea K2VALUE (T1, T2), T2
602 mov T1, OFFSET(14) (DATA)
606 mov OFFSET(15) (DATA), T1
607 xor OFFSET(1) (DATA), T1
612 xor OFFSET(7) (DATA), T1
613 xor OFFSET(12) (DATA), T1
616 mov T1, OFFSET(15) (DATA)
617 lea K2VALUE (T1, T2), T2
621 mov OFFSET(0) (DATA), T1
622 xor OFFSET(2) (DATA), T1
623 xor OFFSET(8) (DATA), T1
628 xor OFFSET(13) (DATA), T1
631 mov T1, OFFSET(0) (DATA)
632 lea K2VALUE (T1, T2), T2
636 mov OFFSET(1) (DATA), T1
637 xor OFFSET(3) (DATA), T1
642 xor OFFSET(9) (DATA), T1
643 xor OFFSET(14) (DATA), T1
646 lea K2VALUE (T1, T2), T2
647 mov T1, OFFSET(1) (DATA)
651 mov OFFSET(2) (DATA), T1
653 xor OFFSET(4) (DATA), T1
656 xor OFFSET(10) (DATA), T1
657 xor OFFSET(15) (DATA), T1
661 mov T1, OFFSET(2) (DATA)
662 lea K2VALUE (T1, T2), T2
666 mov OFFSET(3) (DATA), T1
667 xor OFFSET(5) (DATA), T1
668 xor OFFSET(11) (DATA), T1
669 xor OFFSET(0) (DATA), T1
676 lea K2VALUE (T1, T2), T2
677 mov T1, OFFSET(3) (DATA)
682 mov OFFSET(4) (DATA), T1
684 xor OFFSET(6) (DATA), T1
685 xor OFFSET(12) (DATA), T1
686 xor OFFSET(1) (DATA), T1
691 lea K2VALUE (T1, T2), T2
692 mov T1, OFFSET(4) (DATA)
697 mov OFFSET(5) (DATA), T1
702 xor OFFSET(7) (DATA), T1
703 xor OFFSET(13) (DATA), T1
704 xor OFFSET(2) (DATA), T1
706 mov T1, OFFSET(5) (DATA)
707 lea K2VALUE (T1, T2), T2
711 mov OFFSET(6) (DATA), T1
712 xor OFFSET(8) (DATA), T1
714 xor OFFSET(14) (DATA), T1
715 xor OFFSET(3) (DATA), T1
717 mov T1, OFFSET(6) (DATA)
722 lea K2VALUE (T1, T2), T2
727 mov OFFSET(7) (DATA), T1
730 xor OFFSET(9) (DATA), T1
733 xor OFFSET(15) (DATA), T1
734 xor OFFSET(4) (DATA), T1
736 mov T1, OFFSET(7) (DATA)
737 lea K2VALUE (T1, T2), T2
741 mov OFFSET(8) (DATA), T1
742 xor OFFSET(10) (DATA), T1
744 xor OFFSET(0) (DATA), T1
747 xor OFFSET(5) (DATA), T1
750 mov T1, OFFSET(8) (DATA)
751 lea K3VALUE (T1, T2), T1
760 mov OFFSET(9) (DATA), T1
761 xor OFFSET(11) (DATA), T1
762 xor OFFSET(1) (DATA), T1
765 xor OFFSET(6) (DATA), T1
768 mov T1, OFFSET(9) (DATA)
769 lea K3VALUE (T1, T2), T1
776 mov OFFSET(10) (DATA), T1
779 xor OFFSET(12) (DATA), T1
780 xor OFFSET(2) (DATA), T1
784 xor OFFSET(7) (DATA), T1
786 mov T1, OFFSET(10) (DATA)
787 lea K3VALUE (T1, T2), T1
793 mov OFFSET(11) (DATA), T1
795 xor OFFSET(13) (DATA), T1
796 xor OFFSET(3) (DATA), T1
798 xor OFFSET(8) (DATA), T1
802 mov T1, OFFSET(11) (DATA)
805 lea K3VALUE (T1, T2), T1
812 mov OFFSET(12) (DATA), T1
813 xor OFFSET(14) (DATA), T1
814 xor OFFSET(4) (DATA), T1
815 xor OFFSET(9) (DATA), T1
820 mov T1, OFFSET(12) (DATA)
823 lea K3VALUE (T1, T2), T1
828 mov OFFSET(13) (DATA), T1
829 xor OFFSET(15) (DATA), T1
831 xor OFFSET(5) (DATA), T1
834 xor OFFSET(10) (DATA), T1
838 mov T1, OFFSET(13) (DATA)
841 lea K3VALUE (T1, T2), T1
847 mov OFFSET(14) (DATA), T1
848 xor OFFSET(0) (DATA), T1
851 xor OFFSET(6) (DATA), T1
853 xor OFFSET(11) (DATA), T1
857 mov T1, OFFSET(14) (DATA)
859 lea K3VALUE (T1, T2), T1
866 mov OFFSET(15) (DATA), T1
867 xor OFFSET(1) (DATA), T1
869 xor OFFSET(7) (DATA), T1
870 xor OFFSET(12) (DATA), T1
875 mov T1, OFFSET(15) (DATA)
877 lea K3VALUE (T1, T2), T1
883 mov OFFSET(0) (DATA), T1
885 xor OFFSET(2) (DATA), T1
886 xor OFFSET(8) (DATA), T1
887 xor OFFSET(13) (DATA), T1
892 mov T1, OFFSET(0) (DATA)
895 lea K3VALUE (T1, T2), T1
902 mov OFFSET(1) (DATA), T1
903 xor OFFSET(3) (DATA), T1
904 xor OFFSET(9) (DATA), T1
906 xor OFFSET(14) (DATA), T1
912 mov T1, OFFSET(1) (DATA)
913 lea K3VALUE (T1, T2), T1
919 mov OFFSET(2) (DATA), T1
921 xor OFFSET(4) (DATA), T1
922 xor OFFSET(10) (DATA), T1
925 xor OFFSET(15) (DATA), T1
929 mov T1, OFFSET(2) (DATA)
931 lea K3VALUE (T1, T2), T1
936 mov OFFSET(3) (DATA), T1
937 xor OFFSET(5) (DATA), T1
938 xor OFFSET(11) (DATA), T1
939 xor OFFSET(0) (DATA), T1
944 mov T1, OFFSET(3) (DATA)
949 lea K3VALUE (T1, T2), T1
955 mov OFFSET(4) (DATA), T1
956 xor OFFSET(6) (DATA), T1
961 xor OFFSET(12) (DATA), T1
964 xor OFFSET(1) (DATA), T1
966 mov T1, OFFSET(4) (DATA)
967 lea K3VALUE (T1, T2), T1
972 mov OFFSET(5) (DATA), T1
973 xor OFFSET(7) (DATA), T1
975 xor OFFSET(13) (DATA), T1
977 xor OFFSET(2) (DATA), T1
983 mov T1, OFFSET(5) (DATA)
985 lea K3VALUE (T1, T2), T1
993 mov OFFSET(6) (DATA), T1
994 xor OFFSET(8) (DATA), T1
995 xor OFFSET(14) (DATA), T1
996 xor OFFSET(3) (DATA), T1
1002 mov T1, OFFSET(6) (DATA)
1003 lea K3VALUE (T1, T2), T1
1008 mov OFFSET(7) (DATA), T1
1009 xor OFFSET(9) (DATA), T1
1012 xor OFFSET(15) (DATA), T1
1017 xor OFFSET(4) (DATA), T1
1020 mov T1, OFFSET(7) (DATA)
1021 lea K3VALUE (T1, T2), T1
1027 mov OFFSET(8) (DATA), T1
1028 xor OFFSET(10) (DATA), T1
1030 xor OFFSET(0) (DATA), T1
1033 xor OFFSET(5) (DATA), T1
1038 mov T1, OFFSET(8) (DATA)
1039 lea K3VALUE (T1, T2), T1
1047 mov OFFSET(9) (DATA), T1
1049 xor OFFSET(11) (DATA), T1
1050 xor OFFSET(1) (DATA), T1
1054 xor OFFSET(6) (DATA), T1
1056 mov T1, OFFSET(9) (DATA)
1057 lea K3VALUE (T1, T2), T1
1065 mov OFFSET(10) (DATA), T1
1066 xor OFFSET(12) (DATA), T1
1067 xor OFFSET(2) (DATA), T1
1071 xor OFFSET(7) (DATA), T1
1074 mov T1, OFFSET(10) (DATA)
1075 lea K3VALUE (T1, T2), T1
1082 mov OFFSET(11) (DATA), T1
1083 xor OFFSET(13) (DATA), T1
1084 xor OFFSET(3) (DATA), T1
1085 xor OFFSET(8) (DATA), T1
1090 mov T1, OFFSET(11) (DATA)
1093 lea K3VALUE (T1, T2), T1
1102 mov OFFSET(12) (DATA), T1
1103 xor OFFSET(14) (DATA), T1
1106 xor OFFSET(4) (DATA), T1
1107 xor OFFSET(9) (DATA), T1
1109 mov T1, OFFSET(12) (DATA)
1112 lea K4VALUE (T1, T2), T2
1116 mov OFFSET(13) (DATA), T1
1117 xor OFFSET(15) (DATA), T1
1121 xor OFFSET(5) (DATA), T1
1123 xor OFFSET(10) (DATA), T1
1125 mov T1, OFFSET(13) (DATA)
1127 lea K4VALUE (T1, T2), T2
1131 mov OFFSET(14) (DATA), T1
1132 xor OFFSET(0) (DATA), T1
1138 xor OFFSET(6) (DATA), T1
1139 xor OFFSET(11) (DATA), T1
1141 lea K4VALUE (T1, T2), T2
1142 mov T1, OFFSET(14) (DATA)
1147 mov OFFSET(15) (DATA), T1
1150 xor OFFSET(1) (DATA), T1
1151 xor OFFSET(7) (DATA), T1
1154 xor OFFSET(12) (DATA), T1
1156 mov T1, OFFSET(15) (DATA)
1157 lea K4VALUE (T1, T2), T2
1161 mov OFFSET(0) (DATA), T1
1163 xor OFFSET(2) (DATA), T1
1166 xor OFFSET(8) (DATA), T1
1168 xor OFFSET(13) (DATA), T1
1171 lea K4VALUE (T1, T2), T2
1172 mov T1, OFFSET(0) (DATA)
1176 mov OFFSET(1) (DATA), T1
1178 xor OFFSET(3) (DATA), T1
1179 xor OFFSET(9) (DATA), T1
1180 xor OFFSET(14) (DATA), T1
1186 lea K4VALUE (T1, T2), T2
1187 mov T1, OFFSET(1) (DATA)
1191 mov OFFSET(2) (DATA), T1
1193 xor OFFSET(4) (DATA), T1
1197 xor OFFSET(10) (DATA), T1
1198 xor OFFSET(15) (DATA), T1
1201 lea K4VALUE (T1, T2), T2
1202 mov T1, OFFSET(2) (DATA)
1206 mov OFFSET(3) (DATA), T1
1207 xor OFFSET(5) (DATA), T1
1208 xor OFFSET(11) (DATA), T1
1209 xor OFFSET(0) (DATA), T1
1214 mov T1, OFFSET(3) (DATA)
1217 lea K4VALUE (T1, T2), T2
1221 mov OFFSET(4) (DATA), T1
1224 xor OFFSET(6) (DATA), T1
1226 xor OFFSET(12) (DATA), T1
1228 xor OFFSET(1) (DATA), T1
1231 lea K4VALUE (T1, T2), T2
1232 mov T1, OFFSET(4) (DATA)
1237 mov OFFSET(5) (DATA), T1
1239 xor OFFSET(7) (DATA), T1
1240 xor OFFSET(13) (DATA), T1
1243 xor OFFSET(2) (DATA), T1
1246 mov T1, OFFSET(5) (DATA)
1247 lea K4VALUE (T1, T2), T2
1251 mov OFFSET(6) (DATA), T1
1252 xor OFFSET(8) (DATA), T1
1253 xor OFFSET(14) (DATA), T1
1255 xor OFFSET(3) (DATA), T1
1260 mov T1, OFFSET(6) (DATA)
1262 lea K4VALUE (T1, T2), T2
1267 mov OFFSET(7) (DATA), T1
1268 xor OFFSET(9) (DATA), T1
1269 xor OFFSET(15) (DATA), T1
1271 xor OFFSET(4) (DATA), T1
1274 mov T1, OFFSET(7) (DATA)
1277 lea K4VALUE (T1, T2), T2
1282 mov OFFSET(8) (DATA), T1
1283 xor OFFSET(10) (DATA), T1
1285 xor OFFSET(0) (DATA), T1
1286 xor OFFSET(5) (DATA), T1
1289 mov T1, OFFSET(8) (DATA)
1292 lea K4VALUE (T1, T2), T2
1298 mov OFFSET(9) (DATA), T1
1300 xor OFFSET(11) (DATA), T1
1301 xor OFFSET(1) (DATA), T1
1302 xor OFFSET(6) (DATA), T1
1306 lea K4VALUE (T1, T2), T2
1307 mov T1, OFFSET(9) (DATA)
1312 mov OFFSET(10) (DATA), T1
1313 xor OFFSET(12) (DATA), T1
1314 xor OFFSET(2) (DATA), T1
1319 xor OFFSET(7) (DATA), T1
1321 mov T1, OFFSET(10) (DATA)
1322 lea K4VALUE (T1, T2), T2
1326 mov OFFSET(11) (DATA), T1
1327 xor OFFSET(13) (DATA), T1
1328 xor OFFSET(3) (DATA), T1
1333 xor OFFSET(8) (DATA), T1
1336 lea K4VALUE (T1, T2), T2
1337 mov T1, OFFSET(11) (DATA)
1341 mov OFFSET(12) (DATA), T1
1343 xor OFFSET(14) (DATA), T1
1346 xor OFFSET(4) (DATA), T1
1349 xor OFFSET(9) (DATA), T1
1351 lea K4VALUE (T1, T2), T2
1352 mov T1, OFFSET(12) (DATA)
1358 mov OFFSET(13) (DATA), T1
1359 xor OFFSET(15) (DATA), T1
1361 xor OFFSET(5) (DATA), T1
1363 xor OFFSET(10) (DATA), T1
1366 lea K4VALUE (T1, T2), T2
1367 mov T1, OFFSET(13) (DATA)
1371 mov OFFSET(14) (DATA), T1
1372 xor OFFSET(0) (DATA), T1
1373 xor OFFSET(6) (DATA), T1
1378 xor OFFSET(11) (DATA), T1
1381 lea K4VALUE (T1, T2), T2
1382 mov T1, OFFSET(14) (DATA)
1386 mov OFFSET(15) (DATA), T1
1387 xor OFFSET(1) (DATA), T1
1388 xor OFFSET(7) (DATA), T1
1391 xor OFFSET(12) (DATA), T1
1396 lea K4VALUE (T1, T2), T2
1398 mov T1, OFFSET(15) (DATA)
1404 C C Load and byteswap data
1407 C SWAP( 0, %eax) SWAP( 1, %ebx) SWAP( 2, %ecx) SWAP( 3, %edx)
1408 C SWAP( 4, %eax) SWAP( 5, %ebx) SWAP( 6, %ecx) SWAP( 7, %edx)
1409 C SWAP( 8, %eax) SWAP( 9, %ebx) SWAP(10, %ecx) SWAP(11, %edx)
1410 C SWAP(12, %eax) SWAP(13, %ebx) SWAP(14, %ecx) SWAP(15, %edx)
1412 C C load the state vector
1420 C ROUND_F1_NOEXP(SA, SB, SC, SD, SE, 0)
1421 C ROUND_F1_NOEXP(SE, SA, SB, SC, SD, 1)
1422 C ROUND_F1_NOEXP(SD, SE, SA, SB, SC, 2)
1423 C ROUND_F1_NOEXP(SC, SD, SE, SA, SB, 3)
1424 C ROUND_F1_NOEXP(SB, SC, SD, SE, SA, 4)
1426 C ROUND_F1_NOEXP(SA, SB, SC, SD, SE, 5)
1427 C ROUND_F1_NOEXP(SE, SA, SB, SC, SD, 6)
1428 C ROUND_F1_NOEXP(SD, SE, SA, SB, SC, 7)
1429 C ROUND_F1_NOEXP(SC, SD, SE, SA, SB, 8)
1430 C ROUND_F1_NOEXP(SB, SC, SD, SE, SA, 9)
1432 C ROUND_F1_NOEXP(SA, SB, SC, SD, SE, 10)
1433 C ROUND_F1_NOEXP(SE, SA, SB, SC, SD, 11)
1434 C ROUND_F1_NOEXP(SD, SE, SA, SB, SC, 12)
1435 C ROUND_F1_NOEXP(SC, SD, SE, SA, SB, 13)
1436 C ROUND_F1_NOEXP(SB, SC, SD, SE, SA, 14)
1438 C ROUND_F1_NOEXP(SA, SB, SC, SD, SE, 15)
1439 C ROUND_F1(SE, SA, SB, SC, SD, 16)
1440 C ROUND_F1(SD, SE, SA, SB, SC, 17)
1441 C ROUND_F1(SC, SD, SE, SA, SB, 18)
1442 C ROUND_F1(SB, SC, SD, SE, SA, 19)
1444 C ROUND_F2(SA, SB, SC, SD, SE, 20, K2VALUE)
1445 C ROUND_F2(SE, SA, SB, SC, SD, 21, K2VALUE)
1446 C ROUND_F2(SD, SE, SA, SB, SC, 22, K2VALUE)
1447 C ROUND_F2(SC, SD, SE, SA, SB, 23, K2VALUE)
1448 C ROUND_F2(SB, SC, SD, SE, SA, 24, K2VALUE)
1450 C ROUND_F2(SA, SB, SC, SD, SE, 25, K2VALUE)
1451 C ROUND_F2(SE, SA, SB, SC, SD, 26, K2VALUE)
1452 C ROUND_F2(SD, SE, SA, SB, SC, 27, K2VALUE)
1453 C ROUND_F2(SC, SD, SE, SA, SB, 28, K2VALUE)
1454 C ROUND_F2(SB, SC, SD, SE, SA, 29, K2VALUE)
1456 C ROUND_F2(SA, SB, SC, SD, SE, 30, K2VALUE)
1457 C ROUND_F2(SE, SA, SB, SC, SD, 31, K2VALUE)
1458 C ROUND_F2(SD, SE, SA, SB, SC, 32, K2VALUE)
1459 C ROUND_F2(SC, SD, SE, SA, SB, 33, K2VALUE)
1460 C ROUND_F2(SB, SC, SD, SE, SA, 34, K2VALUE)
1462 C ROUND_F2(SA, SB, SC, SD, SE, 35, K2VALUE)
1463 C ROUND_F2(SE, SA, SB, SC, SD, 36, K2VALUE)
1464 C ROUND_F2(SD, SE, SA, SB, SC, 37, K2VALUE)
1465 C ROUND_F2(SC, SD, SE, SA, SB, 38, K2VALUE)
1466 C ROUND_F2(SB, SC, SD, SE, SA, 39, K2VALUE)
1468 C ROUND_F3(SA, SB, SC, SD, SE, 40)
1469 C ROUND_F3(SE, SA, SB, SC, SD, 41)
1470 C ROUND_F3(SD, SE, SA, SB, SC, 42)
1471 C ROUND_F3(SC, SD, SE, SA, SB, 43)
1472 C ROUND_F3(SB, SC, SD, SE, SA, 44)
1474 C ROUND_F3(SA, SB, SC, SD, SE, 45)
1475 C ROUND_F3(SE, SA, SB, SC, SD, 46)
1476 C ROUND_F3(SD, SE, SA, SB, SC, 47)
1477 C ROUND_F3(SC, SD, SE, SA, SB, 48)
1478 C ROUND_F3(SB, SC, SD, SE, SA, 49)
1480 C ROUND_F3(SA, SB, SC, SD, SE, 50)
1481 C ROUND_F3(SE, SA, SB, SC, SD, 51)
1482 C ROUND_F3(SD, SE, SA, SB, SC, 52)
1483 C ROUND_F3(SC, SD, SE, SA, SB, 53)
1484 C ROUND_F3(SB, SC, SD, SE, SA, 54)
1486 C ROUND_F3(SA, SB, SC, SD, SE, 55)
1487 C ROUND_F3(SE, SA, SB, SC, SD, 56)
1488 C ROUND_F3(SD, SE, SA, SB, SC, 57)
1489 C ROUND_F3(SC, SD, SE, SA, SB, 58)
1490 C ROUND_F3(SB, SC, SD, SE, SA, 59)
1492 C ROUND_F2(SA, SB, SC, SD, SE, 60, K4VALUE)
1493 C ROUND_F2(SE, SA, SB, SC, SD, 61, K4VALUE)
1494 C ROUND_F2(SD, SE, SA, SB, SC, 62, K4VALUE)
1495 C ROUND_F2(SC, SD, SE, SA, SB, 63, K4VALUE)
1496 C ROUND_F2(SB, SC, SD, SE, SA, 64, K4VALUE)
1498 C ROUND_F2(SA, SB, SC, SD, SE, 65, K4VALUE)
1499 C ROUND_F2(SE, SA, SB, SC, SD, 66, K4VALUE)
1500 C ROUND_F2(SD, SE, SA, SB, SC, 67, K4VALUE)
1501 C ROUND_F2(SC, SD, SE, SA, SB, 68, K4VALUE)
1502 C ROUND_F2(SB, SC, SD, SE, SA, 69, K4VALUE)
1504 C ROUND_F2(SA, SB, SC, SD, SE, 70, K4VALUE)
1505 C ROUND_F2(SE, SA, SB, SC, SD, 71, K4VALUE)
1506 C ROUND_F2(SD, SE, SA, SB, SC, 72, K4VALUE)
1507 C ROUND_F2(SC, SD, SE, SA, SB, 73, K4VALUE)
1508 C ROUND_F2(SB, SC, SD, SE, SA, 74, K4VALUE)
1510 C ROUND_F2(SA, SB, SC, SD, SE, 75, K4VALUE)
1511 C ROUND_F2(SE, SA, SB, SC, SD, 76, K4VALUE)
1512 C ROUND_F2(SD, SE, SA, SB, SC, 77, K4VALUE)
1513 C ROUND_F2(SC, SD, SE, SA, SB, 78, K4VALUE)
1514 C ROUND_F2(SB, SC, SD, SE, SA, 79, K4VALUE)
1516 C Update the state vector
1530 EPILOGUE(_nettle_sha1_compress)
1534 C * Extend loopmixer so that it can exploit associativity, and for
1540 C * Use mmx instructions for the data expansion, doing two words at a