|
Packit |
6c4009 |
/* MD5 using sparc crypto opcodes.
|
|
Packit |
6c4009 |
Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
Contributed by David S. Miller (davem@davemloft.net)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <sysdep.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#define ASI_PL 0x88
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#define MD5 \
|
|
Packit |
6c4009 |
.word 0x81b02800;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
.text
|
|
Packit |
6c4009 |
.align 32
|
|
Packit |
6c4009 |
ENTRY(__md5_process_block_crop)
|
|
Packit |
6c4009 |
/* %o0=buffer, %o1=len, %o2=CTX */
|
|
Packit |
6c4009 |
ld [%o2 + 0x10], %g1
|
|
Packit |
6c4009 |
add %g1, %o1, %o4
|
|
Packit |
6c4009 |
st %o4, [%o2 + 0x10]
|
|
Packit |
6c4009 |
clr %o5
|
|
Packit |
6c4009 |
cmp %o4, %g1
|
|
Packit |
6c4009 |
movlu %icc, 1, %o5
|
|
Packit |
6c4009 |
#ifdef __arch64__
|
|
Packit |
6c4009 |
srlx %o1, 32, %o4
|
|
Packit |
6c4009 |
add %o5, %o4, %o5
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
ld [%o2 + 0x14], %o4
|
|
Packit |
6c4009 |
add %o4, %o5, %o4
|
|
Packit |
6c4009 |
st %o4, [%o2 + 0x14]
|
|
Packit |
6c4009 |
lda [%o2] ASI_PL, %f0
|
|
Packit |
6c4009 |
add %o2, 0x4, %g1
|
|
Packit |
6c4009 |
lda [%g1] ASI_PL, %f1
|
|
Packit |
6c4009 |
add %o2, 0x8, %g1
|
|
Packit |
6c4009 |
andcc %o0, 0x7, %g0
|
|
Packit |
6c4009 |
lda [%g1] ASI_PL, %f2
|
|
Packit |
6c4009 |
add %o2, 0xc, %g1
|
|
Packit |
6c4009 |
bne,pn %xcc, 10f
|
|
Packit |
6c4009 |
lda [%g1] ASI_PL, %f3
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
1:
|
|
Packit |
6c4009 |
ldd [%o0 + 0x00], %f8
|
|
Packit |
6c4009 |
ldd [%o0 + 0x08], %f10
|
|
Packit |
6c4009 |
ldd [%o0 + 0x10], %f12
|
|
Packit |
6c4009 |
ldd [%o0 + 0x18], %f14
|
|
Packit |
6c4009 |
ldd [%o0 + 0x20], %f16
|
|
Packit |
6c4009 |
ldd [%o0 + 0x28], %f18
|
|
Packit |
6c4009 |
ldd [%o0 + 0x30], %f20
|
|
Packit |
6c4009 |
ldd [%o0 + 0x38], %f22
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
MD5
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
subcc %o1, 64, %o1
|
|
Packit |
6c4009 |
bne,pt %xcc, 1b
|
|
Packit |
6c4009 |
add %o0, 0x40, %o0
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
5:
|
|
Packit |
6c4009 |
sta %f0, [%o2] ASI_PL
|
|
Packit |
6c4009 |
add %o2, 0x4, %g1
|
|
Packit |
6c4009 |
sta %f1, [%g1] ASI_PL
|
|
Packit |
6c4009 |
add %o2, 0x8, %g1
|
|
Packit |
6c4009 |
sta %f2, [%g1] ASI_PL
|
|
Packit |
6c4009 |
add %o2, 0xc, %g1
|
|
Packit |
6c4009 |
retl
|
|
Packit |
6c4009 |
sta %f3, [%g1] ASI_PL
|
|
Packit |
6c4009 |
10:
|
|
Packit |
6c4009 |
alignaddr %o0, %g0, %o0
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ldd [%o0 + 0x00], %f10
|
|
Packit |
6c4009 |
1:
|
|
Packit |
6c4009 |
ldd [%o0 + 0x08], %f12
|
|
Packit |
6c4009 |
ldd [%o0 + 0x10], %f14
|
|
Packit |
6c4009 |
ldd [%o0 + 0x18], %f16
|
|
Packit |
6c4009 |
ldd [%o0 + 0x20], %f18
|
|
Packit |
6c4009 |
ldd [%o0 + 0x28], %f20
|
|
Packit |
6c4009 |
ldd [%o0 + 0x30], %f22
|
|
Packit |
6c4009 |
ldd [%o0 + 0x38], %f24
|
|
Packit |
6c4009 |
ldd [%o0 + 0x40], %f26
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
faligndata %f10, %f12, %f8
|
|
Packit |
6c4009 |
faligndata %f12, %f14, %f10
|
|
Packit |
6c4009 |
faligndata %f14, %f16, %f12
|
|
Packit |
6c4009 |
faligndata %f16, %f18, %f14
|
|
Packit |
6c4009 |
faligndata %f18, %f20, %f16
|
|
Packit |
6c4009 |
faligndata %f20, %f22, %f18
|
|
Packit |
6c4009 |
faligndata %f22, %f24, %f20
|
|
Packit |
6c4009 |
faligndata %f24, %f26, %f22
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
MD5
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
subcc %o1, 64, %o1
|
|
Packit |
6c4009 |
fsrc2 %f26, %f10
|
|
Packit |
6c4009 |
bne,pt %xcc, 1b
|
|
Packit |
6c4009 |
add %o0, 0x40, %o0
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ba,a,pt %xcc, 5b
|
|
Packit |
6c4009 |
END(__md5_process_block_crop)
|