1 # salsa20_pm.s version 20051229
5 # enter ECRYPT_encrypt_bytes
8 .globl ECRYPT_encrypt_bytes
25 movl 4(%esp,%eax),%edx
27 movl 8(%esp,%eax),%esi
29 movl 12(%esp,%eax),%edi
31 movl 16(%esp,%eax),%ebx
34 # goto done if unsigned<=
37 # in0 = *(uint32 *) (x + 0)
39 # in1 = *(uint32 *) (x + 4)
41 # in2 = *(uint32 *) (x + 8)
45 # in3 = *(uint32 *) (x + 12)
49 # in4 = *(uint32 *) (x + 16)
53 # in5 = *(uint32 *) (x + 20)
57 # in6 = *(uint32 *) (x + 24)
61 # in7 = *(uint32 *) (x + 28)
65 # in8 = *(uint32 *) (x + 32)
69 # in9 = *(uint32 *) (x + 36)
73 # in10 = *(uint32 *) (x + 40)
77 # in11 = *(uint32 *) (x + 44)
81 # in12 = *(uint32 *) (x + 48)
85 # in13 = *(uint32 *) (x + 52)
89 # in14 = *(uint32 *) (x + 56)
93 # in15 = *(uint32 *) (x + 60)
106 # goto nocopy if unsigned>=
114 # while (i) { *out++ = *m++; --i }
125 # bytes_backup = bytes
732 # goto mainloop if unsigned >
754 # in0 ^= *(uint32 *) (m + 0)
756 # in1 ^= *(uint32 *) (m + 4)
758 # *(uint32 *) (out + 0) = in0
760 # *(uint32 *) (out + 4) = in1
770 # in2 ^= *(uint32 *) (m + 8)
772 # in3 ^= *(uint32 *) (m + 12)
774 # *(uint32 *) (out + 8) = in2
776 # *(uint32 *) (out + 12) = in3
786 # in4 ^= *(uint32 *) (m + 16)
788 # in5 ^= *(uint32 *) (m + 20)
790 # *(uint32 *) (out + 16) = in4
792 # *(uint32 *) (out + 20) = in5
802 # in6 ^= *(uint32 *) (m + 24)
804 # in7 ^= *(uint32 *) (m + 28)
806 # *(uint32 *) (out + 24) = in6
808 # *(uint32 *) (out + 28) = in7
818 # in8 ^= *(uint32 *) (m + 32)
820 # in9 ^= *(uint32 *) (m + 36)
822 # *(uint32 *) (out + 32) = in8
824 # *(uint32 *) (out + 36) = in9
834 # in10 ^= *(uint32 *) (m + 40)
836 # in11 ^= *(uint32 *) (m + 44)
838 # *(uint32 *) (out + 40) = in10
840 # *(uint32 *) (out + 44) = in11
850 # in12 ^= *(uint32 *) (m + 48)
852 # in13 ^= *(uint32 *) (m + 52)
854 # *(uint32 *) (out + 48) = in12
856 # *(uint32 *) (out + 52) = in13
866 # in14 ^= *(uint32 *) (m + 56)
868 # in15 ^= *(uint32 *) (m + 60)
870 # *(uint32 *) (out + 56) = in14
872 # *(uint32 *) (out + 60) = in15
874 # bytes = bytes_backup
890 # goto bytesatleast65 if unsigned>
892 # goto bytesatleast64 if unsigned>=
900 # while (i) { *out++ = *m++; --i }
909 # *(uint32 *) (x + 32) = in8
911 # *(uint32 *) (x + 36) = in9
936 # enter ECRYPT_keysetup
939 .globl ECRYPT_keysetup
956 movl 8(%esp,%eax),%ecx
958 movl 12(%esp,%eax),%edx
960 movl 4(%esp,%eax),%eax
961 # in1 = *(uint32 *) (k + 0)
963 # in2 = *(uint32 *) (k + 4)
965 # in3 = *(uint32 *) (k + 8)
967 # in4 = *(uint32 *) (k + 12)
969 # *(uint32 *) (x + 4) = in1
971 # *(uint32 *) (x + 8) = in2
973 # *(uint32 *) (x + 12) = in3
975 # *(uint32 *) (x + 16) = in4
979 # goto kbits128 if unsigned<
982 # in11 = *(uint32 *) (k + 16)
984 # in12 = *(uint32 *) (k + 20)
986 # in13 = *(uint32 *) (k + 24)
988 # in14 = *(uint32 *) (k + 28)
990 # *(uint32 *) (x + 44) = in11
992 # *(uint32 *) (x + 48) = in12
994 # *(uint32 *) (x + 52) = in13
996 # *(uint32 *) (x + 56) = in14
1003 mov $2036477234,%ebx
1005 mov $1797285236,%esi
1006 # *(uint32 *) (x + 0) = in0
1008 # *(uint32 *) (x + 20) = in5
1010 # *(uint32 *) (x + 40) = in10
1012 # *(uint32 *) (x + 60) = in15
1017 # in11 = *(uint32 *) (k + 0)
1019 # in12 = *(uint32 *) (k + 4)
1021 # in13 = *(uint32 *) (k + 8)
1023 # in14 = *(uint32 *) (k + 12)
1025 # *(uint32 *) (x + 44) = in11
1027 # *(uint32 *) (x + 48) = in12
1029 # *(uint32 *) (x + 52) = in13
1031 # *(uint32 *) (x + 56) = in14
1034 mov $1634760805,%ecx
1038 mov $2036477238,%ebx
1040 mov $1797285236,%esi
1041 # *(uint32 *) (x + 0) = in0
1043 # *(uint32 *) (x + 20) = in5
1045 # *(uint32 *) (x + 40) = in10
1047 # *(uint32 *) (x + 60) = in15
1063 # enter ECRYPT_ivsetup
1066 .globl ECRYPT_ivsetup
1083 movl 8(%esp,%eax),%ecx
1085 movl 4(%esp,%eax),%eax
1086 # in6 = *(uint32 *) (iv + 0)
1088 # in7 = *(uint32 *) (iv + 4)
1094 # *(uint32 *) (x + 24) = in6
1096 # *(uint32 *) (x + 28) = in7
1098 # *(uint32 *) (x + 32) = in8
1100 # *(uint32 *) (x + 36) = in9