1 # salsa20_pm.s version 20051229
5 #include <linux/linkage.h>
9 # enter salsa20_encrypt_bytes
10 ENTRY(salsa20_encrypt_bytes)
26 movl 4(%esp,%eax),%edx
28 movl 8(%esp,%eax),%esi
30 movl 12(%esp,%eax),%edi
32 movl 16(%esp,%eax),%ebx
35 # goto done if unsigned<=
38 # in0 = *(uint32 *) (x + 0)
40 # in1 = *(uint32 *) (x + 4)
42 # in2 = *(uint32 *) (x + 8)
46 # in3 = *(uint32 *) (x + 12)
50 # in4 = *(uint32 *) (x + 16)
54 # in5 = *(uint32 *) (x + 20)
58 # in6 = *(uint32 *) (x + 24)
62 # in7 = *(uint32 *) (x + 28)
66 # in8 = *(uint32 *) (x + 32)
70 # in9 = *(uint32 *) (x + 36)
74 # in10 = *(uint32 *) (x + 40)
78 # in11 = *(uint32 *) (x + 44)
82 # in12 = *(uint32 *) (x + 48)
86 # in13 = *(uint32 *) (x + 52)
90 # in14 = *(uint32 *) (x + 56)
94 # in15 = *(uint32 *) (x + 60)
107 # goto nocopy if unsigned>=
115 # while (i) { *out++ = *m++; --i }
126 # bytes_backup = bytes
733 # goto mainloop if unsigned >
755 # in0 ^= *(uint32 *) (m + 0)
757 # in1 ^= *(uint32 *) (m + 4)
759 # *(uint32 *) (out + 0) = in0
761 # *(uint32 *) (out + 4) = in1
771 # in2 ^= *(uint32 *) (m + 8)
773 # in3 ^= *(uint32 *) (m + 12)
775 # *(uint32 *) (out + 8) = in2
777 # *(uint32 *) (out + 12) = in3
787 # in4 ^= *(uint32 *) (m + 16)
789 # in5 ^= *(uint32 *) (m + 20)
791 # *(uint32 *) (out + 16) = in4
793 # *(uint32 *) (out + 20) = in5
803 # in6 ^= *(uint32 *) (m + 24)
805 # in7 ^= *(uint32 *) (m + 28)
807 # *(uint32 *) (out + 24) = in6
809 # *(uint32 *) (out + 28) = in7
819 # in8 ^= *(uint32 *) (m + 32)
821 # in9 ^= *(uint32 *) (m + 36)
823 # *(uint32 *) (out + 32) = in8
825 # *(uint32 *) (out + 36) = in9
835 # in10 ^= *(uint32 *) (m + 40)
837 # in11 ^= *(uint32 *) (m + 44)
839 # *(uint32 *) (out + 40) = in10
841 # *(uint32 *) (out + 44) = in11
851 # in12 ^= *(uint32 *) (m + 48)
853 # in13 ^= *(uint32 *) (m + 52)
855 # *(uint32 *) (out + 48) = in12
857 # *(uint32 *) (out + 52) = in13
867 # in14 ^= *(uint32 *) (m + 56)
869 # in15 ^= *(uint32 *) (m + 60)
871 # *(uint32 *) (out + 56) = in14
873 # *(uint32 *) (out + 60) = in15
875 # bytes = bytes_backup
891 # goto bytesatleast65 if unsigned>
893 # goto bytesatleast64 if unsigned>=
901 # while (i) { *out++ = *m++; --i }
910 # *(uint32 *) (x + 32) = in8
912 # *(uint32 *) (x + 36) = in9
937 ENDPROC(salsa20_encrypt_bytes)
939 # enter salsa20_keysetup
940 ENTRY(salsa20_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 ENDPROC(salsa20_keysetup)
1065 # enter salsa20_ivsetup
1066 ENTRY(salsa20_ivsetup)
1082 movl 8(%esp,%eax),%ecx
1084 movl 4(%esp,%eax),%eax
1085 # in6 = *(uint32 *) (iv + 0)
1087 # in7 = *(uint32 *) (iv + 4)
1093 # *(uint32 *) (x + 24) = in6
1095 # *(uint32 *) (x + 28) = in7
1097 # *(uint32 *) (x + 32) = in8
1099 # *(uint32 *) (x + 36) = in9
1114 ENDPROC(salsa20_ivsetup)