2 # Copyright (c) 2011-2012, Andy Polyakov <appro@openssl.org>
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
9 # * Redistributions of source code must retain copyright notices,
10 # this list of conditions and the following disclaimer.
12 # * Redistributions in binary form must reproduce the above
13 # copyright notice, this list of conditions and the following
14 # disclaimer in the documentation and/or other materials
15 # provided with the distribution.
17 # * Neither the name of the Andy Polyakov nor the names of its
18 # copyright holder and contributors may be used to endorse or
19 # promote products derived from this software without specific
20 # prior written permission.
22 # ALTERNATIVELY, provided that this notice is retained in full, this
23 # product may be distributed under the terms of the GNU General Public
24 # License (GPL), in which case the provisions of the GPL apply INSTEAD OF
27 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS
28 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 # *** This file is auto-generated ***
43 .globl _padlock_capability
73 .globl _padlock_key_bswap
88 .globl _padlock_verify_context
91 _padlock_verify_context:
94 leaq L$padlock_saved_context(%rip),%rax
95 call _padlock_verify_ctx
115 .globl _padlock_reload_key
124 .globl _padlock_aes_block
132 .byte 0xf3,0x0f,0xa7,0xc8
137 .globl _padlock_xstore
146 .globl _padlock_sha1_oneshot
149 _padlock_sha1_oneshot:
159 .byte 0xf3,0x0f,0xa6,0xc8
168 .globl _padlock_sha1_blocks
171 _padlock_sha1_blocks:
181 .byte 0xf3,0x0f,0xa6,0xc8
190 .globl _padlock_sha256_oneshot
193 _padlock_sha256_oneshot:
198 movups 16(%rdi),%xmm1
201 movaps %xmm1,16(%rsp)
203 .byte 0xf3,0x0f,0xa6,0xd0
205 movaps 16(%rsp),%xmm1
208 movups %xmm1,16(%rdx)
212 .globl _padlock_sha256_blocks
215 _padlock_sha256_blocks:
220 movups 16(%rdi),%xmm1
223 movaps %xmm1,16(%rsp)
225 .byte 0xf3,0x0f,0xa6,0xd0
227 movaps 16(%rsp),%xmm1
230 movups %xmm1,16(%rdx)
234 .globl _padlock_sha512_blocks
237 _padlock_sha512_blocks:
242 movups 16(%rdi),%xmm1
243 movups 32(%rdi),%xmm2
244 movups 48(%rdi),%xmm3
247 movaps %xmm1,16(%rsp)
248 movaps %xmm2,32(%rsp)
249 movaps %xmm3,48(%rsp)
250 .byte 0xf3,0x0f,0xa6,0xe0
252 movaps 16(%rsp),%xmm1
253 movaps 32(%rsp),%xmm2
254 movaps 48(%rsp),%xmm3
257 movups %xmm1,16(%rdx)
258 movups %xmm2,32(%rdx)
259 movups %xmm3,48(%rdx)
262 .globl _padlock_ecb_encrypt
265 _padlock_ecb_encrypt:
274 leaq L$padlock_saved_context(%rip),%rax
277 call _padlock_verify_ctx
299 leaq (%rax,%rbp,1),%rsp
314 jz L$ecb_unaligned_tail
338 .byte 0xf3,0x0f,0xa7,200
358 L$ecb_unaligned_tail:
391 leaq (%rsi,%rcx,1),%rbp
400 jz L$ecb_aligned_tail
404 .byte 0xf3,0x0f,0xa7,200
429 .globl _padlock_cbc_encrypt
432 _padlock_cbc_encrypt:
441 leaq L$padlock_saved_context(%rip),%rax
444 call _padlock_verify_ctx
466 leaq (%rax,%rbp,1),%rsp
481 jz L$cbc_unaligned_tail
505 .byte 0xf3,0x0f,0xa7,208
507 movdqa %xmm0,-16(%rdx)
527 L$cbc_unaligned_tail:
560 leaq (%rsi,%rcx,1),%rbp
569 jz L$cbc_aligned_tail
573 .byte 0xf3,0x0f,0xa7,208
575 movdqa %xmm0,-16(%rdx)
600 .globl _padlock_cfb_encrypt
603 _padlock_cfb_encrypt:
612 leaq L$padlock_saved_context(%rip),%rax
615 call _padlock_verify_ctx
637 leaq (%rax,%rbp,1),%rsp
663 .byte 0xf3,0x0f,0xa7,224
665 movdqa %xmm0,-16(%rdx)
703 .byte 0xf3,0x0f,0xa7,224
705 movdqa %xmm0,-16(%rdx)
714 .globl _padlock_ofb_encrypt
717 _padlock_ofb_encrypt:
726 leaq L$padlock_saved_context(%rip),%rax
729 call _padlock_verify_ctx
751 leaq (%rax,%rbp,1),%rsp
777 .byte 0xf3,0x0f,0xa7,232
779 movdqa %xmm0,-16(%rdx)
817 .byte 0xf3,0x0f,0xa7,232
819 movdqa %xmm0,-16(%rdx)
828 .globl _padlock_ctr32_encrypt
831 _padlock_ctr32_encrypt:
840 leaq L$padlock_saved_context(%rip),%rax
843 call _padlock_verify_ctx
865 leaq (%rax,%rbp,1),%rsp
891 jz L$ctr32_unaligned_tail
905 jz L$ctr32_inp_aligned
915 .byte 0xf3,0x0f,0xa7,216
917 testl $4294901760,%eax
927 jz L$ctr32_out_aligned
955 L$ctr32_unaligned_tail:
998 jbe L$ctr32_aligned_skip
1000 L$ctr32_aligned_loop:
1008 .byte 0xf3,0x0f,0xa7,216
1021 jae L$ctr32_aligned_loop
1023 L$ctr32_aligned_skip:
1024 leaq (%rsi,%rcx,1),%rbp
1033 jz L$ctr32_aligned_tail
1037 .byte 0xf3,0x0f,0xa7,216
1041 L$ctr32_aligned_tail:
1049 .byte 0xf3,0x48,0xa5
1062 .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
1066 L$padlock_saved_context: