1 # Copyright (c) 2011-2012, Andy Polyakov <appro@openssl.org>
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions
8 # * Redistributions of source code must retain copyright notices,
9 # this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above
12 # copyright notice, this list of conditions and the following
13 # disclaimer in the documentation and/or other materials
14 # provided with the distribution.
16 # * Neither the name of the Andy Polyakov nor the names of its
17 # copyright holder and contributors may be used to endorse or
18 # promote products derived from this software without specific
19 # prior written permission.
21 # ALTERNATIVELY, provided that this notice is retained in full, this
22 # product may be distributed under the terms of the GNU General Public
23 # License (GPL), in which case the provisions of the GPL apply INSTEAD OF
26 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS
27 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 # *** This file is auto-generated ***
41 .globl padlock_capability
42 .def padlock_capability; .scl 2; .type 32; .endef
71 .globl padlock_key_bswap
72 .def padlock_key_bswap; .scl 2; .type 32; .endef
86 .globl padlock_verify_context
87 .def padlock_verify_context; .scl 2; .type 32; .endef
89 padlock_verify_context:
92 leaq .Lpadlock_saved_context(%rip),%rax
93 call _padlock_verify_ctx
98 .def _padlock_verify_ctx; .scl 3; .type 32; .endef
113 .globl padlock_reload_key
114 .def padlock_reload_key; .scl 2; .type 32; .endef
122 .globl padlock_aes_block
123 .def padlock_aes_block; .scl 2; .type 32; .endef
129 .LSEH_begin_padlock_aes_block:
138 .byte 0xf3,0x0f,0xa7,0xc8
143 .LSEH_end_padlock_aes_block:
145 .globl padlock_xstore
146 .def padlock_xstore; .scl 2; .type 32; .endef
152 .LSEH_begin_padlock_xstore:
161 .LSEH_end_padlock_xstore:
163 .globl padlock_sha1_oneshot
164 .def padlock_sha1_oneshot; .scl 2; .type 32; .endef
166 padlock_sha1_oneshot:
170 .LSEH_begin_padlock_sha1_oneshot:
184 .byte 0xf3,0x0f,0xa6,0xc8
193 .LSEH_end_padlock_sha1_oneshot:
195 .globl padlock_sha1_blocks
196 .def padlock_sha1_blocks; .scl 2; .type 32; .endef
202 .LSEH_begin_padlock_sha1_blocks:
216 .byte 0xf3,0x0f,0xa6,0xc8
225 .LSEH_end_padlock_sha1_blocks:
227 .globl padlock_sha256_oneshot
228 .def padlock_sha256_oneshot; .scl 2; .type 32; .endef
230 padlock_sha256_oneshot:
234 .LSEH_begin_padlock_sha256_oneshot:
243 movups 16(%rdi),%xmm1
246 movaps %xmm1,16(%rsp)
248 .byte 0xf3,0x0f,0xa6,0xd0
250 movaps 16(%rsp),%xmm1
253 movups %xmm1,16(%rdx)
257 .LSEH_end_padlock_sha256_oneshot:
259 .globl padlock_sha256_blocks
260 .def padlock_sha256_blocks; .scl 2; .type 32; .endef
262 padlock_sha256_blocks:
266 .LSEH_begin_padlock_sha256_blocks:
275 movups 16(%rdi),%xmm1
278 movaps %xmm1,16(%rsp)
280 .byte 0xf3,0x0f,0xa6,0xd0
282 movaps 16(%rsp),%xmm1
285 movups %xmm1,16(%rdx)
289 .LSEH_end_padlock_sha256_blocks:
291 .globl padlock_sha512_blocks
292 .def padlock_sha512_blocks; .scl 2; .type 32; .endef
294 padlock_sha512_blocks:
298 .LSEH_begin_padlock_sha512_blocks:
307 movups 16(%rdi),%xmm1
308 movups 32(%rdi),%xmm2
309 movups 48(%rdi),%xmm3
312 movaps %xmm1,16(%rsp)
313 movaps %xmm2,32(%rsp)
314 movaps %xmm3,48(%rsp)
315 .byte 0xf3,0x0f,0xa6,0xe0
317 movaps 16(%rsp),%xmm1
318 movaps 32(%rsp),%xmm2
319 movaps 48(%rsp),%xmm3
322 movups %xmm1,16(%rdx)
323 movups %xmm2,32(%rdx)
324 movups %xmm3,48(%rdx)
328 .LSEH_end_padlock_sha512_blocks:
329 .globl padlock_ecb_encrypt
330 .def padlock_ecb_encrypt; .scl 2; .type 32; .endef
336 .LSEH_begin_padlock_ecb_encrypt:
350 leaq .Lpadlock_saved_context(%rip),%rax
353 call _padlock_verify_ctx
375 leaq (%rax,%rbp,1),%rsp
390 jz .Lecb_unaligned_tail
414 .byte 0xf3,0x0f,0xa7,200
434 .Lecb_unaligned_tail:
467 leaq (%rsi,%rcx,1),%rbp
476 jz .Lecb_aligned_tail
480 .byte 0xf3,0x0f,0xa7,200
506 .LSEH_end_padlock_ecb_encrypt:
507 .globl padlock_cbc_encrypt
508 .def padlock_cbc_encrypt; .scl 2; .type 32; .endef
514 .LSEH_begin_padlock_cbc_encrypt:
528 leaq .Lpadlock_saved_context(%rip),%rax
531 call _padlock_verify_ctx
553 leaq (%rax,%rbp,1),%rsp
568 jz .Lcbc_unaligned_tail
592 .byte 0xf3,0x0f,0xa7,208
594 movdqa %xmm0,-16(%rdx)
614 .Lcbc_unaligned_tail:
647 leaq (%rsi,%rcx,1),%rbp
656 jz .Lcbc_aligned_tail
660 .byte 0xf3,0x0f,0xa7,208
662 movdqa %xmm0,-16(%rdx)
688 .LSEH_end_padlock_cbc_encrypt:
689 .globl padlock_cfb_encrypt
690 .def padlock_cfb_encrypt; .scl 2; .type 32; .endef
696 .LSEH_begin_padlock_cfb_encrypt:
710 leaq .Lpadlock_saved_context(%rip),%rax
713 call _padlock_verify_ctx
735 leaq (%rax,%rbp,1),%rsp
761 .byte 0xf3,0x0f,0xa7,224
763 movdqa %xmm0,-16(%rdx)
801 .byte 0xf3,0x0f,0xa7,224
803 movdqa %xmm0,-16(%rdx)
813 .LSEH_end_padlock_cfb_encrypt:
814 .globl padlock_ofb_encrypt
815 .def padlock_ofb_encrypt; .scl 2; .type 32; .endef
821 .LSEH_begin_padlock_ofb_encrypt:
835 leaq .Lpadlock_saved_context(%rip),%rax
838 call _padlock_verify_ctx
860 leaq (%rax,%rbp,1),%rsp
886 .byte 0xf3,0x0f,0xa7,232
888 movdqa %xmm0,-16(%rdx)
926 .byte 0xf3,0x0f,0xa7,232
928 movdqa %xmm0,-16(%rdx)
938 .LSEH_end_padlock_ofb_encrypt:
939 .globl padlock_ctr32_encrypt
940 .def padlock_ctr32_encrypt; .scl 2; .type 32; .endef
942 padlock_ctr32_encrypt:
946 .LSEH_begin_padlock_ctr32_encrypt:
960 leaq .Lpadlock_saved_context(%rip),%rax
963 call _padlock_verify_ctx
985 leaq (%rax,%rbp,1),%rsp
1011 jz .Lctr32_unaligned_tail
1025 jz .Lctr32_inp_aligned
1027 .byte 0xf3,0x48,0xa5
1031 .Lctr32_inp_aligned:
1035 .byte 0xf3,0x0f,0xa7,216
1037 testl $4294901760,%eax
1038 jnz .Lctr32_no_carry
1047 jz .Lctr32_out_aligned
1051 .byte 0xf3,0x48,0xa5
1053 .Lctr32_out_aligned:
1075 .Lctr32_unaligned_tail:
1084 .byte 0xf3,0x48,0xa5
1118 jbe .Lctr32_aligned_skip
1120 .Lctr32_aligned_loop:
1128 .byte 0xf3,0x0f,0xa7,216
1141 jae .Lctr32_aligned_loop
1143 .Lctr32_aligned_skip:
1144 leaq (%rsi,%rcx,1),%rbp
1153 jz .Lctr32_aligned_tail
1157 .byte 0xf3,0x0f,0xa7,216
1161 .Lctr32_aligned_tail:
1169 .byte 0xf3,0x48,0xa5
1183 .LSEH_end_padlock_ctr32_encrypt:
1184 .byte 86,73,65,32,80,97,100,108,111,99,107,32,120,56,54,95,54,52,32,109,111,100,117,108,101,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
1188 .Lpadlock_saved_context: