1 # Copyright (c) 2011, Andy Polyakov by <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.
39 .globl _padlock_capability
69 .globl _padlock_key_bswap
84 .globl _padlock_verify_context
87 _padlock_verify_context
:
90 leaq
L$padlock_saved_context
(%rip
),%rax
91 call _padlock_verify_ctx
111 .globl _padlock_reload_key
120 .globl _padlock_aes_block
128 .byte 0xf3,0x0f,0xa7,0xc8
133 .globl _padlock_xstore
142 .globl _padlock_sha1_oneshot
145 _padlock_sha1_oneshot
:
155 .byte 0xf3,0x0f,0xa6,0xc8
164 .globl _padlock_sha1_blocks
167 _padlock_sha1_blocks
:
177 .byte 0xf3,0x0f,0xa6,0xc8
186 .globl _padlock_sha256_oneshot
189 _padlock_sha256_oneshot
:
194 movups
16(%rdi
),%xmm1
197 movaps
%xmm1
,16(%rsp
)
199 .byte 0xf3,0x0f,0xa6,0xd0
201 movaps
16(%rsp
),%xmm1
204 movups
%xmm1
,16(%rdx
)
208 .globl _padlock_sha256_blocks
211 _padlock_sha256_blocks
:
216 movups
16(%rdi
),%xmm1
219 movaps
%xmm1
,16(%rsp
)
221 .byte 0xf3,0x0f,0xa6,0xd0
223 movaps
16(%rsp
),%xmm1
226 movups
%xmm1
,16(%rdx
)
230 .globl _padlock_sha512_blocks
233 _padlock_sha512_blocks
:
238 movups
16(%rdi
),%xmm1
239 movups
32(%rdi
),%xmm2
240 movups
48(%rdi
),%xmm3
243 movaps
%xmm1
,16(%rsp
)
244 movaps
%xmm2
,32(%rsp
)
245 movaps
%xmm3
,48(%rsp
)
246 .byte 0xf3,0x0f,0xa6,0xe0
248 movaps
16(%rsp
),%xmm1
249 movaps
32(%rsp
),%xmm2
250 movaps
48(%rsp
),%xmm3
253 movups
%xmm1
,16(%rdx
)
254 movups
%xmm2
,32(%rdx
)
255 movups
%xmm3
,48(%rdx
)
258 .globl _padlock_ecb_encrypt
261 _padlock_ecb_encrypt
:
270 leaq
L$padlock_saved_context
(%rip
),%rax
273 call _padlock_verify_ctx
297 leaq
(%rax
,%rbp
,1),%rsp
321 .byte 0xf3,0x0f,0xa7,200
360 movups
(%rsi
,%rbx
,1),%xmm0
363 movaps
%xmm0
,-16(%rsp
,%rbx
,1)
373 .byte 0xf3,0x0f,0xa7,200
382 .globl _padlock_cbc_encrypt
385 _padlock_cbc_encrypt
:
394 leaq
L$padlock_saved_context
(%rip
),%rax
397 call _padlock_verify_ctx
421 leaq
(%rax
,%rbp
,1),%rsp
445 .byte 0xf3,0x0f,0xa7,208
447 movdqa
%xmm0
,-16(%rdx
)
486 movups
(%rsi
,%rbx
,1),%xmm0
489 movaps
%xmm0
,-16(%rsp
,%rbx
,1)
499 .byte 0xf3,0x0f,0xa7,208
501 movdqa
%xmm0
,-16(%rdx
)
510 .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
514 L$padlock_saved_context
: