author | Misaki Miyashita <Misaki.Miyashita@Oracle.COM> |
Tue, 11 Jun 2013 12:58:54 -0700 | |
changeset 1341 | af3d6ef22d65 |
parent 1294 | c7701e5ea3fc |
child 1373 | 2fd83bee8884 |
permissions | -rw-r--r-- |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
1 |
# |
1341
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
2 |
# This file adds inline T4 instruction support to OpenSSL upstream code. |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
3 |
# |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
4 |
Index: Configure |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
5 |
=================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
6 |
diff -ru openssl-1.0.1e/Configure openssl-1.0.1e/Configure |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
7 |
--- openssl-1.0.1e/Configure 2011-05-24 17:02:24.000000000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
8 |
+++ openssl-1.0.1e/Configure 2011-07-27 10:48:17.817470000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
9 |
@@ -135,7 +135,7 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
10 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
11 |
my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o modexp512-x86_64.o::aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o rc4-md5-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:ghash-x86_64.o:"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
12 |
my $ia64_asm="ia64cpuid.o:bn-ia64.o ia64-mont.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::ghash-ia64.o::void"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
13 |
-my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void"; |
1341
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
14 |
+my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o aest4-sparcv9.o::md5-sparcv9.o:sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void"; |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
15 |
my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::::void"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
16 |
my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o:::::sha1-alpha.o:::::::ghash-alpha.o::void"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
17 |
my $mips32_asm=":bn-mips.o::aes_cbc.o aes-mips.o:::sha1-mips.o sha256-mips.o::::::::"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
18 |
Index: crypto/sparccpuid.S |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
19 |
=================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
20 |
diff -ru openssl-1.0.1e/crypto/sparccpuid.S openssl-1.0.1e/crypto/sparccpuid.S |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
21 |
--- openssl-1.0.1e/crypto/sparccpuid.S 2011-05-24 17:02:24.000000000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
22 |
+++ openssl-1.0.1e/crypto/sparccpuid.S 2011-07-27 10:48:17.817470000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
23 |
@@ -251,6 +251,11 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
24 |
! UltraSPARC IIe 7 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
25 |
! UltraSPARC III 7 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
26 |
! UltraSPARC T1 24 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
27 |
+! SPARC T4 65(*) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
28 |
+! |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
29 |
+! (*) result has lesser to do with VIS instruction latencies, rdtick |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
30 |
+! appears that slow, but it does the trick in sense that FP and |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
31 |
+! VIS code paths are still slower than integer-only ones. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
32 |
! |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
33 |
! Numbers for T2 and SPARC64 V-VII are more than welcomed. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
34 |
! |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
35 |
@@ -260,6 +265,8 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
36 |
.global _sparcv9_vis1_instrument |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
37 |
.align 8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
38 |
_sparcv9_vis1_instrument: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
39 |
+ .word 0x81b00d80 !fxor %f0,%f0,%f0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
40 |
+ .word 0x85b08d82 !fxor %f2,%f2,%f2 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
41 |
.word 0x91410000 !rd %tick,%o0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
42 |
.word 0x81b00d80 !fxor %f0,%f0,%f0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
43 |
.word 0x85b08d82 !fxor %f2,%f2,%f2 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
44 |
@@ -314,6 +321,30 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
45 |
.type _sparcv9_fmadd_probe,#function |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
46 |
.size _sparcv9_fmadd_probe,.-_sparcv9_fmadd_probe |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
47 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
48 |
+.global _sparcv9_rdcfr |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
49 |
+.align 8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
50 |
+_sparcv9_rdcfr: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
51 |
+ retl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
52 |
+ .word 0x91468000 !rd %asr26,%o0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
53 |
+.type _sparcv9_rdcfr,#function |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
54 |
+.size _sparcv9_rdcfr,.-_sparcv9_rdcfr |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
55 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
56 |
+.global _sparcv9_vis3_probe |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
57 |
+.align 8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
58 |
+_sparcv9_vis3_probe: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
59 |
+ retl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
60 |
+ .word 0x81b022a0 !xmulx %g0,%g0,%g0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
61 |
+.type _sparcv9_vis3_probe,#function |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
62 |
+.size _sparcv9_vis3_probe,.-_sparcv9_vis3_probe |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
63 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
64 |
+.global _sparcv9_random |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
65 |
+.align 8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
66 |
+_sparcv9_random: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
67 |
+ retl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
68 |
+ .word 0x91b002a0 !random %o0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
69 |
+.type _sparcv9_random,#function |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
70 |
+.size _sparcv9_random,.-_sparcv9_vis3_probe |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
71 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
72 |
.global OPENSSL_cleanse |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
73 |
.align 32 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
74 |
OPENSSL_cleanse: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
75 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
76 |
Index: crypto/sparcv9cap.c |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
77 |
=================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
78 |
diff -ru openssl-1.0.1e/crypto/sparcv9cap.c openssl-1.0.1e/crypto/sparcv9cap.c |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
79 |
--- openssl-1.0.1e/crypto/sparcv9cap.c 2011-05-24 17:02:24.000000000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
80 |
+++ openssl-1.0.1e/crypto/sparcv9cap.c 2011-07-27 10:48:17.817470000 -0700 |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
81 |
@@ -6,16 +6,15 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
82 |
#include <sys/time.h> |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
83 |
#include <openssl/bn.h> |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
84 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
85 |
-#define SPARCV9_TICK_PRIVILEGED (1<<0) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
86 |
-#define SPARCV9_PREFER_FPU (1<<1) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
87 |
-#define SPARCV9_VIS1 (1<<2) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
88 |
-#define SPARCV9_VIS2 (1<<3) /* reserved */ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
89 |
-#define SPARCV9_FMADD (1<<4) /* reserved for SPARC64 V */ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
90 |
+#include "sparc_arch.h" |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
91 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
92 |
+#if defined(__GNUC__) && defined(__linux) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
93 |
+__attribute__((visibility("hidden"))) |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
94 |
+#endif |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
95 |
#ifndef _BOOT |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
96 |
-static int OPENSSL_sparcv9cap_P=SPARCV9_TICK_PRIVILEGED; |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
97 |
+unsigned int OPENSSL_sparcv9cap_P[2]={SPARCV9_TICK_PRIVILEGED,0}; |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
98 |
#else |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
99 |
-static int OPENSSL_sparcv9cap_P = SPARCV9_VIS1; |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
100 |
+unsigned int OPENSSL_sparcv9cap_P[2]={SPARCV9_VIS1,0}; |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
101 |
#endif |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
102 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
103 |
int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np,const BN_ULONG *n0, int num) |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
104 |
@@ -24,7 +23,7 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
105 |
int bn_mul_mont_int(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np,const BN_ULONG *n0, int num); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
106 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
107 |
if (num>=8 && !(num&1) && |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
108 |
- (OPENSSL_sparcv9cap_P&(SPARCV9_PREFER_FPU|SPARCV9_VIS1)) == |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
109 |
+ (OPENSSL_sparcv9cap_P[0]&(SPARCV9_PREFER_FPU|SPARCV9_VIS1)) == |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
110 |
(SPARCV9_PREFER_FPU|SPARCV9_VIS1)) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
111 |
return bn_mul_mont_fpu(rp,ap,bp,np,n0,num); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
112 |
else |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
113 |
@@ -36,11 +35,16 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
114 |
unsigned long _sparcv9_vis1_instrument(void); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
115 |
void _sparcv9_vis2_probe(void); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
116 |
void _sparcv9_fmadd_probe(void); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
117 |
+unsigned long _sparcv9_rdcfr(void); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
118 |
+void _sparcv9_vis3_probe(void); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
119 |
+unsigned long _sparcv9_random(void); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
120 |
+size_t _sparcv9_vis1_instrument_bus(unsigned int *,size_t); |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
121 |
+size_t _sparcv9_vis1_instrument_bus2(unsigned int *,size_t,size_t); |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
122 |
|
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
123 |
#ifndef _BOOT |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
124 |
unsigned long OPENSSL_rdtsc(void) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
125 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
126 |
- if (OPENSSL_sparcv9cap_P&SPARCV9_TICK_PRIVILEGED) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
127 |
+ if (OPENSSL_sparcv9cap_P[0]&SPARCV9_TICK_PRIVILEGED) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
128 |
#if defined(__sun) && defined(__SVR4) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
129 |
return gethrtime(); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
130 |
#else |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
131 |
@@ -51,6 +55,25 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
132 |
} |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
133 |
#endif |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
134 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
135 |
+size_t OPENSSL_instrument_bus(unsigned int *out,size_t cnt) |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
136 |
+ { |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
137 |
+ if (OPENSSL_sparcv9cap_P[0]&(SPARCV9_TICK_PRIVILEGED|SPARCV9_BLK) == |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
138 |
+ SPARCV9_BLK) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
139 |
+ return _sparcv9_vis1_instrument_bus(out,cnt); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
140 |
+ else |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
141 |
+ return 0; |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
142 |
+ } |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
143 |
+ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
144 |
+size_t OPENSSL_instrument_bus2(unsigned int *out,size_t cnt,size_t max) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
145 |
+ { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
146 |
+ if (OPENSSL_sparcv9cap_P[0]&(SPARCV9_TICK_PRIVILEGED|SPARCV9_BLK) == |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
147 |
+ SPARCV9_BLK) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
148 |
+ return _sparcv9_vis1_instrument_bus2(out,cnt,max); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
149 |
+ else |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
150 |
+ return 0; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
151 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
152 |
+ |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
153 |
+ |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
154 |
#if defined(_BOOT) |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
155 |
/* |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
156 |
* Hardcoding sparc capabilities for wanboot. |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
157 |
@@ -58,7 +81,7 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
158 |
*/ |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
159 |
void OPENSSL_cpuid_setup(void) |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
160 |
{ |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
161 |
- OPENSSL_sparcv9cap_P = SPARCV9_VIS1; |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
162 |
+ OPENSSL_sparcv9cap_P[0] = SPARCV9_VIS1; |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
163 |
} |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
164 |
|
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
165 |
#elif 0 && defined(__sun) && defined(__SVR4) |
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
166 |
@@ -85,11 +108,11 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
167 |
if (!strcmp (name,"SUNW,UltraSPARC") || |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
168 |
!strncmp(name,"SUNW,UltraSPARC-I",17)) /* covers II,III,IV */ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
169 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
170 |
- OPENSSL_sparcv9cap_P |= SPARCV9_PREFER_FPU|SPARCV9_VIS1; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
171 |
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_PREFER_FPU|SPARCV9_VIS1; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
172 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
173 |
/* %tick is privileged only on UltraSPARC-I/II, but not IIe */ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
174 |
if (name[14]!='\0' && name[17]!='\0' && name[18]!='\0') |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
175 |
- OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
176 |
+ OPENSSL_sparcv9cap_P[0] &= ~SPARCV9_TICK_PRIVILEGED; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
177 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
178 |
return DI_WALK_TERMINATE; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
179 |
} |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
180 |
@@ -96,7 +119,7 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
181 |
/* This is expected to catch remaining UltraSPARCs, such as T1 */ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
182 |
else if (!strncmp(name,"SUNW,UltraSPARC",15)) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
183 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
184 |
- OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
185 |
+ OPENSSL_sparcv9cap_P[0] &= ~SPARCV9_TICK_PRIVILEGED; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
186 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
187 |
return DI_WALK_TERMINATE; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
188 |
} |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
189 |
@@ -115,7 +138,7 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
190 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
191 |
if ((e=getenv("OPENSSL_sparcv9cap"))) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
192 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
193 |
- OPENSSL_sparcv9cap_P=strtoul(e,NULL,0); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
194 |
+ OPENSSL_sparcv9cap_P[0]=strtoul(e,NULL,0); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
195 |
return; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
196 |
} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
197 |
|
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
198 |
@@ -123,17 +146,17 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
199 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
200 |
if (strcmp(si,"sun4v")) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
201 |
/* FPU is preferred for all CPUs, but US-T1/2 */ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
202 |
- OPENSSL_sparcv9cap_P |= SPARCV9_PREFER_FPU; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
203 |
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_PREFER_FPU; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
204 |
} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
205 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
206 |
if (sysinfo(SI_ISALIST,si,sizeof(si))>0) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
207 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
208 |
if (strstr(si,"+vis")) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
209 |
- OPENSSL_sparcv9cap_P |= SPARCV9_VIS1; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
210 |
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS1|SPARCV9_BLK; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
211 |
if (strstr(si,"+vis2")) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
212 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
213 |
- OPENSSL_sparcv9cap_P |= SPARCV9_VIS2; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
214 |
- OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
215 |
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS2; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
216 |
+ OPENSSL_sparcv9cap_P[0] &= ~SPARCV9_TICK_PRIVILEGED; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
217 |
return; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
218 |
} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
219 |
} |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
220 |
@@ -193,12 +216,14 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
221 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
222 |
if ((e=getenv("OPENSSL_sparcv9cap"))) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
223 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
224 |
- OPENSSL_sparcv9cap_P=strtoul(e,NULL,0); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
225 |
+ OPENSSL_sparcv9cap_P[0]=strtoul(e,NULL,0); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
226 |
+ if ((e=strchr(e,':'))) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
227 |
+ OPENSSL_sparcv9cap_P[1]=strtoul(e+1,NULL,0); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
228 |
return; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
229 |
} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
230 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
231 |
/* Initial value, fits UltraSPARC-I&II... */ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
232 |
- OPENSSL_sparcv9cap_P = SPARCV9_PREFER_FPU|SPARCV9_TICK_PRIVILEGED; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
233 |
+ OPENSSL_sparcv9cap_P[0] = SPARCV9_PREFER_FPU|SPARCV9_TICK_PRIVILEGED; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
234 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
235 |
sigfillset(&all_masked); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
236 |
sigdelset(&all_masked,SIGILL); |
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
237 |
@@ -221,20 +246,20 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
238 |
if (sigsetjmp(common_jmp,1) == 0) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
239 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
240 |
_sparcv9_rdtick(); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
241 |
- OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
242 |
+ OPENSSL_sparcv9cap_P[0] &= ~SPARCV9_TICK_PRIVILEGED; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
243 |
} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
244 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
245 |
if (sigsetjmp(common_jmp,1) == 0) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
246 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
247 |
_sparcv9_vis1_probe(); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
248 |
- OPENSSL_sparcv9cap_P |= SPARCV9_VIS1; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
249 |
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS1|SPARCV9_BLK; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
250 |
/* detect UltraSPARC-Tx, see sparccpud.S for details... */ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
251 |
if (_sparcv9_vis1_instrument() >= 12) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
252 |
- OPENSSL_sparcv9cap_P &= ~(SPARCV9_VIS1|SPARCV9_PREFER_FPU); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
253 |
+ OPENSSL_sparcv9cap_P[0] &= ~(SPARCV9_VIS1|SPARCV9_PREFER_FPU); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
254 |
else |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
255 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
256 |
_sparcv9_vis2_probe(); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
257 |
- OPENSSL_sparcv9cap_P |= SPARCV9_VIS2; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
258 |
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS2; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
259 |
} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
260 |
} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
261 |
|
1294
c7701e5ea3fc
16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1267
diff
changeset
|
262 |
@@ -241,9 +266,37 @@ |
1267
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
263 |
if (sigsetjmp(common_jmp,1) == 0) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
264 |
{ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
265 |
_sparcv9_fmadd_probe(); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
266 |
- OPENSSL_sparcv9cap_P |= SPARCV9_FMADD; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
267 |
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_FMADD; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
268 |
} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
269 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
270 |
+ /* |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
271 |
+ * VIS3 flag is tested independently from VIS1, unlike VIS2 that is, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
272 |
+ * because VIS3 defines even integer instructions. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
273 |
+ */ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
274 |
+ if (sigsetjmp(common_jmp,1) == 0) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
275 |
+ { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
276 |
+ _sparcv9_vis3_probe(); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
277 |
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
278 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
279 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
280 |
+ if (sigsetjmp(common_jmp,1) == 0) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
281 |
+ { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
282 |
+ (void)_sparcv9_random(); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
283 |
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_RANDOM; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
284 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
285 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
286 |
+ /* |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
287 |
+ * In wait for better solution _sparcv9_rdcfr is masked by |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
288 |
+ * VIS3 flag, because it goes to uninterruptable endless |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
289 |
+ * loop on UltraSPARC II running Solaris. Things might be |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
290 |
+ * different on Linux... |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
291 |
+ */ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
292 |
+ if ((OPENSSL_sparcv9cap_P[0]&SPARCV9_VIS3) && |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
293 |
+ sigsetjmp(common_jmp,1) == 0) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
294 |
+ { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
295 |
+ OPENSSL_sparcv9cap_P[1] = (unsigned int)_sparcv9_rdcfr(); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
296 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
297 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
298 |
sigaction(SIGBUS,&bus_oact,NULL); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
299 |
sigaction(SIGILL,&ill_oact,NULL); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
300 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
301 |
Index: crypto/md5/Makefile |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
302 |
=================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
303 |
diff -ru openssl-1.0.1e/crypto/md5/Makefile openssl-1.0.1e/crypto/md5/Makefile |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
304 |
--- openssl-1.0.1e/crypto/md5/Makefile 2011-05-24 17:02:24.000000000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
305 |
+++ openssl-1.0.1e/crypto/md5/Makefile 2011-07-27 10:48:17.817470000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
306 |
@@ -52,6 +52,9 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
307 |
$(CC) $(CFLAGS) -E asm/md5-ia64.S | \ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
308 |
$(PERL) -ne 's/;\s+/;\n/g; print;' > $@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
309 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
310 |
+md5-sparcv9.S: asm/md5-sparcv9.pl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
311 |
+ $(PERL) asm/md5-sparcv9.pl $@ $(CFLAGS) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
312 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
313 |
files: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
314 |
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
315 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
316 |
Index: crypto/md5/md5_locl.h |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
317 |
=================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
318 |
diff -ru openssl-1.0.1e/crypto/md5/md5_locl.h openssl-1.0.1e/crypto/md5/md5_locl.h |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
319 |
--- openssl-1.0.1e/crypto/md5/md5_locl.h 2011-05-24 17:02:24.000000000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
320 |
+++ openssl-1.0.1e/crypto/md5/md5_locl.h 2011-07-27 10:48:17.817470000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
321 |
@@ -71,6 +71,8 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
322 |
# define md5_block_data_order md5_block_asm_data_order |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
323 |
# elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
324 |
# define md5_block_data_order md5_block_asm_data_order |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
325 |
+# elif defined(__sparc) || defined(__sparc__) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
326 |
+# define md5_block_data_order md5_block_asm_data_order |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
327 |
# endif |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
328 |
#endif |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
329 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
330 |
Index: crypto/sha/Makefile |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
331 |
=================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
332 |
diff -ru openssl-1.0.1e/crypto/sha/Makefile openssl-1.0.1e/crypto/sha/Makefile |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
333 |
--- openssl-1.0.1e/crypto/sha/Makefile 2011-05-24 17:02:24.000000000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
334 |
+++ openssl-1.0.1e/crypto/sha/Makefile 2011-07-27 10:48:17.817470000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
335 |
@@ -66,9 +66,9 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
336 |
sha1-x86_64.s: asm/sha1-x86_64.pl; $(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
337 |
sha256-x86_64.s:asm/sha512-x86_64.pl; $(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
338 |
sha512-x86_64.s:asm/sha512-x86_64.pl; $(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
339 |
-sha1-sparcv9.s: asm/sha1-sparcv9.pl; $(PERL) asm/sha1-sparcv9.pl $@ $(CFLAGS) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
340 |
-sha256-sparcv9.s:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
341 |
-sha512-sparcv9.s:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
342 |
+sha1-sparcv9.S: asm/sha1-sparcv9.pl; $(PERL) asm/sha1-sparcv9.pl $@ $(CFLAGS) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
343 |
+sha256-sparcv9.S:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
344 |
+sha512-sparcv9.S:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
345 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
346 |
sha1-ppc.s: asm/sha1-ppc.pl; $(PERL) asm/sha1-ppc.pl $(PERLASM_SCHEME) $@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
347 |
sha256-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
348 |
Index: crypto/sha/asm/sha1-sparcv9.pl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
349 |
=================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
350 |
diff -ru openssl-1.0.1e/crypto/sha/asm/sha1-sparcv9.pl openssl-1.0.1e/crypto/sha/asm/sha1-sparcv9.pl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
351 |
--- openssl-1.0.1e/crypto/sha/asm/sha1-sparcv9.pl 2011-05-24 17:02:24.000000000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
352 |
+++ openssl-1.0.1e/crypto/sha/asm/sha1-sparcv9.pl 2011-07-27 10:48:17.817470000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
353 |
@@ -5,6 +5,8 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
354 |
# project. The module is, however, dual licensed under OpenSSL and |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
355 |
# CRYPTOGAMS licenses depending on where you obtain it. For further |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
356 |
# details see http://www.openssl.org/~appro/cryptogams/. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
357 |
+# |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
358 |
+# Hardware SPARC T4 support by David S. Miller <[email protected]>. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
359 |
# ==================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
360 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
361 |
# Performance improvement is not really impressive on pre-T1 CPU: +8% |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
362 |
@@ -18,6 +20,11 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
363 |
# ensure scalability on UltraSPARC T1, or rather to avoid decay when |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
364 |
# amount of active threads exceeds the number of physical cores. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
365 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
366 |
+# SPARC T4 SHA1 hardware achieves 3.72 cycles per byte, which is 3.1x |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
367 |
+# faster than software. Multi-process benchmark saturates at 11x |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
368 |
+# single-process result on 8-core processor, or ~9GBps per 2.85GHz |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
369 |
+# socket. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
370 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
371 |
$bits=32; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
372 |
for (@ARGV) { $bits=64 if (/\-m64/ || /\-xarch\=v9/); } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
373 |
if ($bits==64) { $bias=2047; $frame=192; } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
374 |
@@ -183,11 +190,93 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
375 |
.register %g3,#scratch |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
376 |
___ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
377 |
$code.=<<___; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
378 |
+#include "sparc_arch.h" |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
379 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
380 |
.section ".text",#alloc,#execinstr |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
381 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
382 |
+#ifdef __PIC__ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
383 |
+SPARC_PIC_THUNK(%g1) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
384 |
+#endif |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
385 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
386 |
.align 32 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
387 |
.globl sha1_block_data_order |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
388 |
sha1_block_data_order: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
389 |
+ SPARC_LOAD_ADDRESS_LEAF(OPENSSL_sparcv9cap_P,%g1,%g5) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
390 |
+ ld [%g1+4],%g1 ! OPENSSL_sparcv9cap_P[1] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
391 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
392 |
+ andcc %g1, CFR_SHA1, %g0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
393 |
+ be .Lsoftware |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
394 |
+ nop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
395 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
396 |
+ ld [%o0 + 0x00], %f0 ! load context |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
397 |
+ ld [%o0 + 0x04], %f1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
398 |
+ ld [%o0 + 0x08], %f2 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
399 |
+ andcc %o1, 0x7, %g0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
400 |
+ ld [%o0 + 0x0c], %f3 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
401 |
+ bne,pn %icc, .Lhwunaligned |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
402 |
+ ld [%o0 + 0x10], %f4 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
403 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
404 |
+.Lhw_loop: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
405 |
+ ldd [%o1 + 0x00], %f8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
406 |
+ ldd [%o1 + 0x08], %f10 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
407 |
+ ldd [%o1 + 0x10], %f12 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
408 |
+ ldd [%o1 + 0x18], %f14 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
409 |
+ ldd [%o1 + 0x20], %f16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
410 |
+ ldd [%o1 + 0x28], %f18 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
411 |
+ ldd [%o1 + 0x30], %f20 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
412 |
+ subcc %o2, 1, %o2 ! done yet? |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
413 |
+ ldd [%o1 + 0x38], %f22 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
414 |
+ add %o1, 0x40, %o1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
415 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
416 |
+ .word 0x81b02820 ! SHA1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
417 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
418 |
+ bne,pt `$bits==64?"%xcc":"%icc"`, .Lhw_loop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
419 |
+ nop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
420 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
421 |
+.Lhwfinish: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
422 |
+ st %f0, [%o0 + 0x00] ! store context |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
423 |
+ st %f1, [%o0 + 0x04] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
424 |
+ st %f2, [%o0 + 0x08] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
425 |
+ st %f3, [%o0 + 0x0c] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
426 |
+ retl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
427 |
+ st %f4, [%o0 + 0x10] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
428 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
429 |
+.align 8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
430 |
+.Lhwunaligned: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
431 |
+ alignaddr %o1, %g0, %o1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
432 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
433 |
+ ldd [%o1 + 0x00], %f10 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
434 |
+.Lhwunaligned_loop: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
435 |
+ ldd [%o1 + 0x08], %f12 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
436 |
+ ldd [%o1 + 0x10], %f14 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
437 |
+ ldd [%o1 + 0x18], %f16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
438 |
+ ldd [%o1 + 0x20], %f18 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
439 |
+ ldd [%o1 + 0x28], %f20 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
440 |
+ ldd [%o1 + 0x30], %f22 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
441 |
+ ldd [%o1 + 0x38], %f24 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
442 |
+ subcc %o2, 1, %o2 ! done yet? |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
443 |
+ ldd [%o1 + 0x40], %f26 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
444 |
+ add %o1, 0x40, %o1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
445 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
446 |
+ faligndata %f10, %f12, %f8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
447 |
+ faligndata %f12, %f14, %f10 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
448 |
+ faligndata %f14, %f16, %f12 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
449 |
+ faligndata %f16, %f18, %f14 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
450 |
+ faligndata %f18, %f20, %f16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
451 |
+ faligndata %f20, %f22, %f18 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
452 |
+ faligndata %f22, %f24, %f20 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
453 |
+ faligndata %f24, %f26, %f22 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
454 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
455 |
+ .word 0x81b02820 ! SHA1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
456 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
457 |
+ bne,pt `$bits==64?"%xcc":"%icc"`, .Lhwunaligned_loop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
458 |
+ for %f26, %f26, %f10 ! %f10=%f26 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
459 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
460 |
+ ba .Lhwfinish |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
461 |
+ nop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
462 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
463 |
+.align 16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
464 |
+.Lsoftware: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
465 |
save %sp,-$frame,%sp |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
466 |
sllx $len,6,$len |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
467 |
add $inp,$len,$len |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
468 |
@@ -279,6 +368,62 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
469 |
.align 4 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
470 |
___ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
471 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
472 |
-$code =~ s/\`([^\`]*)\`/eval $1/gem; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
473 |
-print $code; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
474 |
+# Purpose of these subroutines is to explicitly encode VIS instructions, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
475 |
+# so that one can compile the module without having to specify VIS |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
476 |
+# extentions on compiler command line, e.g. -xarch=v9 vs. -xarch=v9a. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
477 |
+# Idea is to reserve for option to produce "universal" binary and let |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
478 |
+# programmer detect if current CPU is VIS capable at run-time. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
479 |
+sub unvis { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
480 |
+my ($mnemonic,$rs1,$rs2,$rd)=@_; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
481 |
+my $ref,$opf; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
482 |
+my %visopf = ( "faligndata" => 0x048, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
483 |
+ "for" => 0x07c ); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
484 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
485 |
+ $ref = "$mnemonic\t$rs1,$rs2,$rd"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
486 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
487 |
+ if ($opf=$visopf{$mnemonic}) { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
488 |
+ foreach ($rs1,$rs2,$rd) { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
489 |
+ return $ref if (!/%f([0-9]{1,2})/); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
490 |
+ $_=$1; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
491 |
+ if ($1>=32) { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
492 |
+ return $ref if ($1&1); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
493 |
+ # re-encode for upper double register addressing |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
494 |
+ $_=($1|$1>>5)&31; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
495 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
496 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
497 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
498 |
+ return sprintf ".word\t0x%08x !%s", |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
499 |
+ 0x81b00000|$rd<<25|$rs1<<14|$opf<<5|$rs2, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
500 |
+ $ref; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
501 |
+ } else { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
502 |
+ return $ref; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
503 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
504 |
+} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
505 |
+sub unalignaddr { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
506 |
+my ($mnemonic,$rs1,$rs2,$rd)=@_; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
507 |
+my %bias = ( "g" => 0, "o" => 8, "l" => 16, "i" => 24 ); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
508 |
+my $ref="$mnemonic\t$rs1,$rs2,$rd"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
509 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
510 |
+ foreach ($rs1,$rs2,$rd) { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
511 |
+ if (/%([goli])([0-7])/) { $_=$bias{$1}+$2; } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
512 |
+ else { return $ref; } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
513 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
514 |
+ return sprintf ".word\t0x%08x !%s", |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
515 |
+ 0x81b00300|$rd<<25|$rs1<<14|$rs2, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
516 |
+ $ref; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
517 |
+} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
518 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
519 |
+foreach (split("\n",$code)) { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
520 |
+ s/\`([^\`]*)\`/eval $1/ge; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
521 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
522 |
+ s/\b(f[^\s]*)\s+(%f[0-9]{1,2}),\s*(%f[0-9]{1,2}),\s*(%f[0-9]{1,2})/ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
523 |
+ &unvis($1,$2,$3,$4) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
524 |
+ /ge; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
525 |
+ s/\b(alignaddr)\s+(%[goli][0-7]),\s*(%[goli][0-7]),\s*(%[goli][0-7])/ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
526 |
+ &unalignaddr($1,$2,$3,$4) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
527 |
+ /ge; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
528 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
529 |
+ print $_,"\n"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
530 |
+} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
531 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
532 |
close STDOUT; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
533 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
534 |
Index: crypto/sha/asm/sha512-sparcv9.pl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
535 |
=================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
536 |
diff -ru openssl-1.0.1e/crypto/sha/asm/sha512-sparcv9.pl openssl-1.0.1e/crypto/sha/asm/sha512-sparcv9.pl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
537 |
--- openssl-1.0.1e/crypto/sha/asm/sha512-sparcv9.pl 2011-05-24 17:02:24.000000000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
538 |
+++ openssl-1.0.1e/crypto/sha/asm/sha512-sparcv9.pl 2011-07-27 10:48:17.817470000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
539 |
@@ -5,6 +5,8 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
540 |
# project. The module is, however, dual licensed under OpenSSL and |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
541 |
# CRYPTOGAMS licenses depending on where you obtain it. For further |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
542 |
# details see http://www.openssl.org/~appro/cryptogams/. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
543 |
+# |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
544 |
+# Hardware SPARC T4 support by David S. Miller <[email protected]>. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
545 |
# ==================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
546 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
547 |
# SHA256 performance improvement over compiler generated code varies |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
548 |
@@ -41,6 +43,12 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
549 |
# loads are always slower than one 64-bit load. Once again this |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
550 |
# is unlike pre-T1 UltraSPARC, where, if scheduled appropriately, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
551 |
# 2x32-bit loads can be as fast as 1x64-bit ones. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
552 |
+# |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
553 |
+# SPARC T4 SHA256/512 hardware achieves 3.17/2.01 cycles per byte, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
554 |
+# which is 9.3x/11.1x faster than software. Multi-process benchmark |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
555 |
+# saturates at 11.5x single-process result on 8-core processor, or |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
556 |
+# ~11/16GBps per 2.85GHz socket. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
557 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
558 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
559 |
$bits=32; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
560 |
for (@ARGV) { $bits=64 if (/\-m64/ || /\-xarch\=v9/); } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
561 |
@@ -386,6 +394,8 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
562 |
.register %g3,#scratch |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
563 |
___ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
564 |
$code.=<<___; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
565 |
+#include "sparc_arch.h" |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
566 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
567 |
.section ".text",#alloc,#execinstr |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
568 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
569 |
.align 64 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
570 |
@@ -457,8 +467,196 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
571 |
} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
572 |
$code.=<<___; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
573 |
.size K${label},.-K${label} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
574 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
575 |
+#ifdef __PIC__ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
576 |
+SPARC_PIC_THUNK(%g1) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
577 |
+#endif |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
578 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
579 |
.globl sha${label}_block_data_order |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
580 |
+.align 32 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
581 |
sha${label}_block_data_order: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
582 |
+ SPARC_LOAD_ADDRESS_LEAF(OPENSSL_sparcv9cap_P,%g1,%g5) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
583 |
+ ld [%g1+4],%g1 ! OPENSSL_sparcv9cap_P[1] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
584 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
585 |
+ andcc %g1, CFR_SHA${label}, %g0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
586 |
+ be .Lsoftware |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
587 |
+ nop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
588 |
+___ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
589 |
+$code.=<<___ if ($SZ==8); # SHA512 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
590 |
+ ldd [%o0 + 0x00], %f0 ! load context |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
591 |
+ ldd [%o0 + 0x08], %f2 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
592 |
+ ldd [%o0 + 0x10], %f4 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
593 |
+ ldd [%o0 + 0x18], %f6 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
594 |
+ ldd [%o0 + 0x20], %f8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
595 |
+ ldd [%o0 + 0x28], %f10 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
596 |
+ andcc %o1, 0x7, %g0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
597 |
+ ldd [%o0 + 0x30], %f12 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
598 |
+ bne,pn %icc, .Lhwunaligned |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
599 |
+ ldd [%o0 + 0x38], %f14 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
600 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
601 |
+.Lhwaligned_loop: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
602 |
+ ldd [%o1 + 0x00], %f16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
603 |
+ ldd [%o1 + 0x08], %f18 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
604 |
+ ldd [%o1 + 0x10], %f20 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
605 |
+ ldd [%o1 + 0x18], %f22 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
606 |
+ ldd [%o1 + 0x20], %f24 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
607 |
+ ldd [%o1 + 0x28], %f26 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
608 |
+ ldd [%o1 + 0x30], %f28 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
609 |
+ ldd [%o1 + 0x38], %f30 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
610 |
+ ldd [%o1 + 0x40], %f32 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
611 |
+ ldd [%o1 + 0x48], %f34 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
612 |
+ ldd [%o1 + 0x50], %f36 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
613 |
+ ldd [%o1 + 0x58], %f38 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
614 |
+ ldd [%o1 + 0x60], %f40 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
615 |
+ ldd [%o1 + 0x68], %f42 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
616 |
+ ldd [%o1 + 0x70], %f44 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
617 |
+ subcc %o2, 1, %o2 ! done yet? |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
618 |
+ ldd [%o1 + 0x78], %f46 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
619 |
+ add %o1, 0x80, %o1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
620 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
621 |
+ .word 0x81b02860 ! SHA512 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
622 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
623 |
+ bne,pt `$bits==64?"%xcc":"%icc"`, .Lhwaligned_loop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
624 |
+ nop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
625 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
626 |
+.Lhwfinish: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
627 |
+ std %f0, [%o0 + 0x00] ! store context |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
628 |
+ std %f2, [%o0 + 0x08] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
629 |
+ std %f4, [%o0 + 0x10] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
630 |
+ std %f6, [%o0 + 0x18] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
631 |
+ std %f8, [%o0 + 0x20] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
632 |
+ std %f10, [%o0 + 0x28] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
633 |
+ std %f12, [%o0 + 0x30] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
634 |
+ retl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
635 |
+ std %f14, [%o0 + 0x38] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
636 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
637 |
+.align 16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
638 |
+.Lhwunaligned: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
639 |
+ alignaddr %o1, %g0, %o1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
640 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
641 |
+ ldd [%o1 + 0x00], %f18 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
642 |
+.Lhwunaligned_loop: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
643 |
+ ldd [%o1 + 0x08], %f20 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
644 |
+ ldd [%o1 + 0x10], %f22 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
645 |
+ ldd [%o1 + 0x18], %f24 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
646 |
+ ldd [%o1 + 0x20], %f26 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
647 |
+ ldd [%o1 + 0x28], %f28 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
648 |
+ ldd [%o1 + 0x30], %f30 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
649 |
+ ldd [%o1 + 0x38], %f32 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
650 |
+ ldd [%o1 + 0x40], %f34 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
651 |
+ ldd [%o1 + 0x48], %f36 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
652 |
+ ldd [%o1 + 0x50], %f38 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
653 |
+ ldd [%o1 + 0x58], %f40 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
654 |
+ ldd [%o1 + 0x60], %f42 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
655 |
+ ldd [%o1 + 0x68], %f44 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
656 |
+ ldd [%o1 + 0x70], %f46 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
657 |
+ ldd [%o1 + 0x78], %f48 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
658 |
+ subcc %o2, 1, %o2 ! done yet? |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
659 |
+ ldd [%o1 + 0x80], %f50 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
660 |
+ add %o1, 0x80, %o1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
661 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
662 |
+ faligndata %f18, %f20, %f16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
663 |
+ faligndata %f20, %f22, %f18 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
664 |
+ faligndata %f22, %f24, %f20 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
665 |
+ faligndata %f24, %f26, %f22 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
666 |
+ faligndata %f26, %f28, %f24 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
667 |
+ faligndata %f28, %f30, %f26 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
668 |
+ faligndata %f30, %f32, %f28 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
669 |
+ faligndata %f32, %f34, %f30 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
670 |
+ faligndata %f34, %f36, %f32 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
671 |
+ faligndata %f36, %f38, %f34 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
672 |
+ faligndata %f38, %f40, %f36 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
673 |
+ faligndata %f40, %f42, %f38 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
674 |
+ faligndata %f42, %f44, %f40 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
675 |
+ faligndata %f44, %f46, %f42 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
676 |
+ faligndata %f46, %f48, %f44 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
677 |
+ faligndata %f48, %f50, %f46 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
678 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
679 |
+ .word 0x81b02860 ! SHA512 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
680 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
681 |
+ bne,pt `$bits==64?"%xcc":"%icc"`, .Lhwunaligned_loop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
682 |
+ for %f50, %f50, %f18 ! %f18=%f50 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
683 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
684 |
+ ba .Lhwfinish |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
685 |
+ nop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
686 |
+___ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
687 |
+$code.=<<___ if ($SZ==4); # SHA256 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
688 |
+ ld [%o0 + 0x00], %f0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
689 |
+ ld [%o0 + 0x04], %f1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
690 |
+ ld [%o0 + 0x08], %f2 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
691 |
+ ld [%o0 + 0x0c], %f3 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
692 |
+ ld [%o0 + 0x10], %f4 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
693 |
+ ld [%o0 + 0x14], %f5 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
694 |
+ andcc %o1, 0x7, %g0 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
695 |
+ ld [%o0 + 0x18], %f6 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
696 |
+ bne,pn %icc, .Lhwunaligned |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
697 |
+ ld [%o0 + 0x1c], %f7 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
698 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
699 |
+.Lhwloop: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
700 |
+ ldd [%o1 + 0x00], %f8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
701 |
+ ldd [%o1 + 0x08], %f10 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
702 |
+ ldd [%o1 + 0x10], %f12 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
703 |
+ ldd [%o1 + 0x18], %f14 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
704 |
+ ldd [%o1 + 0x20], %f16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
705 |
+ ldd [%o1 + 0x28], %f18 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
706 |
+ ldd [%o1 + 0x30], %f20 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
707 |
+ subcc %o2, 1, %o2 ! done yet? |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
708 |
+ ldd [%o1 + 0x38], %f22 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
709 |
+ add %o1, 0x40, %o1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
710 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
711 |
+ .word 0x81b02840 ! SHA256 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
712 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
713 |
+ bne,pt `$bits==64?"%xcc":"%icc"`, .Lhwloop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
714 |
+ nop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
715 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
716 |
+.Lhwfinish: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
717 |
+ st %f0, [%o0 + 0x00] ! store context |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
718 |
+ st %f1, [%o0 + 0x04] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
719 |
+ st %f2, [%o0 + 0x08] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
720 |
+ st %f3, [%o0 + 0x0c] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
721 |
+ st %f4, [%o0 + 0x10] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
722 |
+ st %f5, [%o0 + 0x14] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
723 |
+ st %f6, [%o0 + 0x18] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
724 |
+ retl |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
725 |
+ st %f7, [%o0 + 0x1c] |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
726 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
727 |
+.align 8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
728 |
+.Lhwunaligned: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
729 |
+ alignaddr %o1, %g0, %o1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
730 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
731 |
+ ldd [%o1 + 0x00], %f10 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
732 |
+.Lhwunaligned_loop: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
733 |
+ ldd [%o1 + 0x08], %f12 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
734 |
+ ldd [%o1 + 0x10], %f14 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
735 |
+ ldd [%o1 + 0x18], %f16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
736 |
+ ldd [%o1 + 0x20], %f18 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
737 |
+ ldd [%o1 + 0x28], %f20 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
738 |
+ ldd [%o1 + 0x30], %f22 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
739 |
+ ldd [%o1 + 0x38], %f24 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
740 |
+ subcc %o2, 1, %o2 ! done yet? |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
741 |
+ ldd [%o1 + 0x40], %f26 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
742 |
+ add %o1, 0x40, %o1 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
743 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
744 |
+ faligndata %f10, %f12, %f8 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
745 |
+ faligndata %f12, %f14, %f10 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
746 |
+ faligndata %f14, %f16, %f12 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
747 |
+ faligndata %f16, %f18, %f14 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
748 |
+ faligndata %f18, %f20, %f16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
749 |
+ faligndata %f20, %f22, %f18 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
750 |
+ faligndata %f22, %f24, %f20 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
751 |
+ faligndata %f24, %f26, %f22 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
752 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
753 |
+ .word 0x81b02840 ! SHA256 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
754 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
755 |
+ bne,pt `$bits==64?"%xcc":"%icc"`, .Lhwunaligned_loop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
756 |
+ for %f26, %f26, %f10 ! %f10=%f26 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
757 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
758 |
+ ba .Lhwfinish |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
759 |
+ nop |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
760 |
+___ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
761 |
+$code.=<<___; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
762 |
+.align 16 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
763 |
+.Lsoftware: |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
764 |
save %sp,`-$frame-$locals`,%sp |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
765 |
and $inp,`$align-1`,$tmp31 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
766 |
sllx $len,`log(16*$SZ)/log(2)`,$len |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
767 |
@@ -589,6 +787,62 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
768 |
.align 4 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
769 |
___ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
770 |
|
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
771 |
-$code =~ s/\`([^\`]*)\`/eval $1/gem; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
772 |
-print $code; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
773 |
+# Purpose of these subroutines is to explicitly encode VIS instructions, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
774 |
+# so that one can compile the module without having to specify VIS |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
775 |
+# extentions on compiler command line, e.g. -xarch=v9 vs. -xarch=v9a. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
776 |
+# Idea is to reserve for option to produce "universal" binary and let |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
777 |
+# programmer detect if current CPU is VIS capable at run-time. |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
778 |
+sub unvis { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
779 |
+my ($mnemonic,$rs1,$rs2,$rd)=@_; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
780 |
+my $ref,$opf; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
781 |
+my %visopf = ( "faligndata" => 0x048, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
782 |
+ "for" => 0x07c ); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
783 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
784 |
+ $ref = "$mnemonic\t$rs1,$rs2,$rd"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
785 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
786 |
+ if ($opf=$visopf{$mnemonic}) { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
787 |
+ foreach ($rs1,$rs2,$rd) { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
788 |
+ return $ref if (!/%f([0-9]{1,2})/); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
789 |
+ $_=$1; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
790 |
+ if ($1>=32) { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
791 |
+ return $ref if ($1&1); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
792 |
+ # re-encode for upper double register addressing |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
793 |
+ $_=($1|$1>>5)&31; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
794 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
795 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
796 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
797 |
+ return sprintf ".word\t0x%08x !%s", |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
798 |
+ 0x81b00000|$rd<<25|$rs1<<14|$opf<<5|$rs2, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
799 |
+ $ref; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
800 |
+ } else { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
801 |
+ return $ref; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
802 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
803 |
+} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
804 |
+sub unalignaddr { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
805 |
+my ($mnemonic,$rs1,$rs2,$rd)=@_; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
806 |
+my %bias = ( "g" => 0, "o" => 8, "l" => 16, "i" => 24 ); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
807 |
+my $ref="$mnemonic\t$rs1,$rs2,$rd"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
808 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
809 |
+ foreach ($rs1,$rs2,$rd) { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
810 |
+ if (/%([goli])([0-7])/) { $_=$bias{$1}+$2; } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
811 |
+ else { return $ref; } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
812 |
+ } |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
813 |
+ return sprintf ".word\t0x%08x !%s", |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
814 |
+ 0x81b00300|$rd<<25|$rs1<<14|$rs2, |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
815 |
+ $ref; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
816 |
+} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
817 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
818 |
+foreach (split("\n",$code)) { |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
819 |
+ s/\`([^\`]*)\`/eval $1/ge; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
820 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
821 |
+ s/\b(f[^\s]*)\s+(%f[0-9]{1,2}),\s*(%f[0-9]{1,2}),\s*(%f[0-9]{1,2})/ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
822 |
+ &unvis($1,$2,$3,$4) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
823 |
+ /ge; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
824 |
+ s/\b(alignaddr)\s+(%[goli][0-7]),\s*(%[goli][0-7]),\s*(%[goli][0-7])/ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
825 |
+ &unalignaddr($1,$2,$3,$4) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
826 |
+ /ge; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
827 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
828 |
+ print $_,"\n"; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
829 |
+} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
830 |
+ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
831 |
close STDOUT; |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
832 |
Index: openssl/apps/speed.c |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
833 |
=================================================================== |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
834 |
diff -ru openssl-1.0.1e/apps/spped.c openssl-1.0.1e/apps/speed.c |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
835 |
--- openssl-1.0.1e/apps/speed.c 2011-05-24 17:02:24.000000000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
836 |
+++ openssl-1.0.1e/apps/spped.c 2011-07-27 10:48:17.817470000 -0700 |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
837 |
@@ -1551,7 +1551,7 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
838 |
print_message(names[D_MD5],c[D_MD5][j],lengths[j]); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
839 |
Time_F(START); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
840 |
for (count=0,run=1; COND(c[D_MD5][j]); count++) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
841 |
- EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md5[0]),NULL,EVP_get_digestbyname("md5"),NULL); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
842 |
+ MD5(buf,lengths[j],md5); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
843 |
d=Time_F(STOP); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
844 |
print_result(D_MD5,j,count,d); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
845 |
} |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
846 |
@@ -1591,7 +1591,7 @@ |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
847 |
print_message(names[D_SHA1],c[D_SHA1][j],lengths[j]); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
848 |
Time_F(START); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
849 |
for (count=0,run=1; COND(c[D_SHA1][j]); count++) |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
850 |
- EVP_Digest(buf,(unsigned long)lengths[j],&(sha[0]),NULL,EVP_sha1(),NULL); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
851 |
+ SHA1(buf,lengths[j],sha); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
852 |
d=Time_F(STOP); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
853 |
print_result(D_SHA1,j,count,d); |
3d7359ef8168
15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff
changeset
|
854 |
} |
1341
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
855 |
Index: openssl/crypto/aes/Makefile |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
856 |
=================================================================== |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
857 |
--- Makefile Thu May 2 13:42:37 2013 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
858 |
+++ Makefile.orig Thu May 2 13:41:51 2013 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
859 |
@@ -73,6 +73,9 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
860 |
aes-sparcv9.s: asm/aes-sparcv9.pl |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
861 |
$(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
862 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
863 |
+aest4-sparcv9.s: asm/aest4-sparcv9.pl |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
864 |
+ $(PERL) asm/aest4-sparcv9.pl $(CFLAGS) > $@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
865 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
866 |
aes-ppc.s: asm/aes-ppc.pl |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
867 |
$(PERL) asm/aes-ppc.pl $(PERLASM_SCHEME) $@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
868 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
869 |
Index: openssl/crypto/evp/e_aes.c |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
870 |
=================================================================== |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
871 |
--- e_aes.c Mon Feb 11 07:26:04 2013 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
872 |
+++ e_aes.c.56 Thu May 2 14:26:35 2013 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
873 |
@@ -56,13 +58,12 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
874 |
#include <assert.h> |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
875 |
#include <openssl/aes.h> |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
876 |
#include "evp_locl.h" |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
877 |
-#ifndef OPENSSL_FIPS |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
878 |
#include "modes_lcl.h" |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
879 |
#include <openssl/rand.h> |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
880 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
881 |
typedef struct |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
882 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
883 |
- AES_KEY ks; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
884 |
+ union { double align; AES_KEY ks; } ks; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
885 |
block128_f block; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
886 |
union { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
887 |
cbc128_f cbc; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
888 |
@@ -72,7 +73,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
889 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
890 |
typedef struct |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
891 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
892 |
- AES_KEY ks; /* AES key schedule to use */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
893 |
+ union { double align; AES_KEY ks; } ks; /* AES key schedule to use */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
894 |
int key_set; /* Set if key initialised */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
895 |
int iv_set; /* Set if an iv is set */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
896 |
GCM128_CONTEXT gcm; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
897 |
@@ -86,7 +87,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
898 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
899 |
typedef struct |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
900 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
901 |
- AES_KEY ks1, ks2; /* AES key schedules to use */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
902 |
+ union { double align; AES_KEY ks; } ks1, ks2; /* AES key schedules to use */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
903 |
XTS128_CONTEXT xts; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
904 |
void (*stream)(const unsigned char *in, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
905 |
unsigned char *out, size_t length, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
906 |
@@ -96,7 +97,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
907 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
908 |
typedef struct |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
909 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
910 |
- AES_KEY ks; /* AES key schedule to use */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
911 |
+ union { double align; AES_KEY ks; } ks; /* AES key schedule to use */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
912 |
int key_set; /* Set if key initialised */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
913 |
int iv_set; /* Set if an iv is set */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
914 |
int tag_set; /* Set if tag is valid */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
915 |
@@ -160,7 +161,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
916 |
defined(_M_AMD64) || defined(_M_X64) || \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
917 |
defined(__INTEL__) ) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
918 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
919 |
-extern unsigned int OPENSSL_ia32cap_P[2]; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
920 |
+extern unsigned int OPENSSL_ia32cap_P[]; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
921 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
922 |
#ifdef VPAES_ASM |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
923 |
#define VPAES_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(41-32))) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
924 |
@@ -310,7 +311,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
925 |
return 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
926 |
if (key) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
927 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
928 |
- aesni_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
929 |
+ aesni_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
930 |
CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
931 |
(block128_f)aesni_encrypt); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
932 |
gctx->ctr = (ctr128_f)aesni_ctr32_encrypt_blocks; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
933 |
@@ -355,19 +356,19 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
934 |
/* key_len is two AES keys */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
935 |
if (enc) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
936 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
937 |
- aesni_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
938 |
+ aesni_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
939 |
xctx->xts.block1 = (block128_f)aesni_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
940 |
xctx->stream = aesni_xts_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
941 |
} |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
942 |
else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
943 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
944 |
- aesni_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
945 |
+ aesni_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
946 |
xctx->xts.block1 = (block128_f)aesni_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
947 |
xctx->stream = aesni_xts_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
948 |
} |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
949 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
950 |
aesni_set_encrypt_key(key + ctx->key_len/2, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
951 |
- ctx->key_len * 4, &xctx->ks2); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
952 |
+ ctx->key_len * 4, &xctx->ks2.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
953 |
xctx->xts.block2 = (block128_f)aesni_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
954 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
955 |
xctx->xts.key1 = &xctx->ks1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
956 |
@@ -394,7 +395,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
957 |
return 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
958 |
if (key) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
959 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
960 |
- aesni_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
961 |
+ aesni_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
962 |
CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
963 |
&cctx->ks, (block128_f)aesni_encrypt); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
964 |
cctx->str = enc?(ccm128_f)aesni_ccm64_encrypt_blocks : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
965 |
@@ -456,6 +457,379 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
966 |
const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
967 |
{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
968 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
969 |
+#elif defined(AES_ASM) && (defined(__sparc) || defined(__sparc__)) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
970 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
971 |
+#include "sparc_arch.h" |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
972 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
973 |
+extern unsigned int OPENSSL_sparcv9cap_P[]; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
974 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
975 |
+#define SPARC_AES_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_AES) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
976 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
977 |
+void aes_t4_set_encrypt_key (const unsigned char *key, int bits, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
978 |
+ AES_KEY *ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
979 |
+void aes_t4_set_decrypt_key (const unsigned char *key, int bits, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
980 |
+ AES_KEY *ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
981 |
+void aes_t4_encrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
982 |
+ const AES_KEY *key); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
983 |
+void aes_t4_decrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
984 |
+ const AES_KEY *key); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
985 |
+/* |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
986 |
+ * Key-length specific subroutines were chosen for following reason. |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
987 |
+ * Each SPARC T4 core can execute up to 8 threads which share core's |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
988 |
+ * resources. Loading as much key material to registers allows to |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
989 |
+ * minimize references to shared memory interface, as well as amount |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
990 |
+ * of instructions in inner loops [much needed on T4]. But then having |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
991 |
+ * non-key-length specific routines would require conditional branches |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
992 |
+ * either in inner loops or on subroutines' entries. Former is hardly |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
993 |
+ * acceptable, while latter means code size increase to size occupied |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
994 |
+ * by multiple key-length specfic subroutines, so why fight? |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
995 |
+ */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
996 |
+void aes128_t4_cbc_encrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
997 |
+ size_t len, const AES_KEY *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
998 |
+ unsigned char *ivec); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
999 |
+void aes128_t4_cbc_decrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1000 |
+ size_t len, const AES_KEY *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1001 |
+ unsigned char *ivec); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1002 |
+void aes192_t4_cbc_encrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1003 |
+ size_t len, const AES_KEY *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1004 |
+ unsigned char *ivec); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1005 |
+void aes192_t4_cbc_decrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1006 |
+ size_t len, const AES_KEY *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1007 |
+ unsigned char *ivec); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1008 |
+void aes256_t4_cbc_encrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1009 |
+ size_t len, const AES_KEY *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1010 |
+ unsigned char *ivec); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1011 |
+void aes256_t4_cbc_decrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1012 |
+ size_t len, const AES_KEY *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1013 |
+ unsigned char *ivec); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1014 |
+void aes128_t4_ctr32_encrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1015 |
+ size_t blocks, const AES_KEY *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1016 |
+ unsigned char *ivec); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1017 |
+void aes192_t4_ctr32_encrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1018 |
+ size_t blocks, const AES_KEY *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1019 |
+ unsigned char *ivec); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1020 |
+void aes256_t4_ctr32_encrypt (const unsigned char *in, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1021 |
+ size_t blocks, const AES_KEY *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1022 |
+ unsigned char *ivec); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1023 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1024 |
+static int aes_t4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1025 |
+ const unsigned char *iv, int enc) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1026 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1027 |
+ int ret, mode, bits; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1028 |
+ EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1029 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1030 |
+ mode = ctx->cipher->flags & EVP_CIPH_MODE; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1031 |
+ bits = ctx->key_len*8; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1032 |
+ if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1033 |
+ && !enc) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1034 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1035 |
+ ret = 0; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1036 |
+ aes_t4_set_decrypt_key(key, bits, ctx->cipher_data); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1037 |
+ dat->block = (block128_f)aes_t4_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1038 |
+ switch (bits) { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1039 |
+ case 128: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1040 |
+ dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1041 |
+ (cbc128_f)aes128_t4_cbc_decrypt : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1042 |
+ NULL; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1043 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1044 |
+ case 192: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1045 |
+ dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1046 |
+ (cbc128_f)aes192_t4_cbc_decrypt : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1047 |
+ NULL; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1048 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1049 |
+ case 256: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1050 |
+ dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1051 |
+ (cbc128_f)aes256_t4_cbc_decrypt : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1052 |
+ NULL; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1053 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1054 |
+ default: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1055 |
+ ret = -1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1056 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1057 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1058 |
+ else { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1059 |
+ ret = 0; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1060 |
+ aes_t4_set_encrypt_key(key, bits, ctx->cipher_data); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1061 |
+ dat->block = (block128_f)aes_t4_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1062 |
+ switch (bits) { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1063 |
+ case 128: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1064 |
+ if (mode==EVP_CIPH_CBC_MODE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1065 |
+ dat->stream.cbc = (cbc128_f)aes128_t4_cbc_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1066 |
+ else if (mode==EVP_CIPH_CTR_MODE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1067 |
+ dat->stream.ctr = (ctr128_f)aes128_t4_ctr32_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1068 |
+ else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1069 |
+ dat->stream.cbc = NULL; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1070 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1071 |
+ case 192: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1072 |
+ if (mode==EVP_CIPH_CBC_MODE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1073 |
+ dat->stream.cbc = (cbc128_f)aes192_t4_cbc_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1074 |
+ else if (mode==EVP_CIPH_CTR_MODE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1075 |
+ dat->stream.ctr = (ctr128_f)aes192_t4_ctr32_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1076 |
+ else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1077 |
+ dat->stream.cbc = NULL; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1078 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1079 |
+ case 256: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1080 |
+ if (mode==EVP_CIPH_CBC_MODE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1081 |
+ dat->stream.cbc = (cbc128_f)aes256_t4_cbc_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1082 |
+ else if (mode==EVP_CIPH_CTR_MODE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1083 |
+ dat->stream.ctr = (ctr128_f)aes256_t4_ctr32_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1084 |
+ else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1085 |
+ dat->stream.cbc = NULL; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1086 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1087 |
+ default: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1088 |
+ ret = -1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1089 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1090 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1091 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1092 |
+ if(ret < 0) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1093 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1094 |
+ EVPerr(EVP_F_AES_T4_INIT_KEY,EVP_R_AES_KEY_SETUP_FAILED); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1095 |
+ return 0; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1096 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1097 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1098 |
+ return 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1099 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1100 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1101 |
+#define aes_t4_cbc_cipher aes_cbc_cipher |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1102 |
+static int aes_t4_cbc_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1103 |
+ const unsigned char *in, size_t len); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1104 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1105 |
+#define aes_t4_ecb_cipher aes_ecb_cipher |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1106 |
+static int aes_t4_ecb_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1107 |
+ const unsigned char *in, size_t len); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1108 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1109 |
+#define aes_t4_ofb_cipher aes_ofb_cipher |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1110 |
+static int aes_t4_ofb_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1111 |
+ const unsigned char *in,size_t len); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1112 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1113 |
+#define aes_t4_cfb_cipher aes_cfb_cipher |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1114 |
+static int aes_t4_cfb_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1115 |
+ const unsigned char *in,size_t len); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1116 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1117 |
+#define aes_t4_cfb8_cipher aes_cfb8_cipher |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1118 |
+static int aes_t4_cfb8_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1119 |
+ const unsigned char *in,size_t len); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1120 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1121 |
+#define aes_t4_cfb1_cipher aes_cfb1_cipher |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1122 |
+static int aes_t4_cfb1_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1123 |
+ const unsigned char *in,size_t len); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1124 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1125 |
+#define aes_t4_ctr_cipher aes_ctr_cipher |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1126 |
+static int aes_t4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1127 |
+ const unsigned char *in, size_t len); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1128 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1129 |
+static int aes_t4_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1130 |
+ const unsigned char *iv, int enc) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1131 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1132 |
+ EVP_AES_GCM_CTX *gctx = ctx->cipher_data; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1133 |
+ if (!iv && !key) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1134 |
+ return 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1135 |
+ if (key) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1136 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1137 |
+ int bits = ctx->key_len * 8; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1138 |
+ aes_t4_set_encrypt_key(key, bits, &gctx->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1139 |
+ CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1140 |
+ (block128_f)aes_t4_encrypt); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1141 |
+ switch (bits) { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1142 |
+ case 128: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1143 |
+ gctx->ctr = (ctr128_f)aes128_t4_ctr32_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1144 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1145 |
+ case 192: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1146 |
+ gctx->ctr = (ctr128_f)aes192_t4_ctr32_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1147 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1148 |
+ case 256: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1149 |
+ gctx->ctr = (ctr128_f)aes256_t4_ctr32_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1150 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1151 |
+ default: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1152 |
+ return 0; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1153 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1154 |
+ /* If we have an iv can set it directly, otherwise use |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1155 |
+ * saved IV. |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1156 |
+ */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1157 |
+ if (iv == NULL && gctx->iv_set) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1158 |
+ iv = gctx->iv; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1159 |
+ if (iv) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1160 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1161 |
+ CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1162 |
+ gctx->iv_set = 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1163 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1164 |
+ gctx->key_set = 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1165 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1166 |
+ else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1167 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1168 |
+ /* If key set use IV, otherwise copy */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1169 |
+ if (gctx->key_set) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1170 |
+ CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1171 |
+ else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1172 |
+ memcpy(gctx->iv, iv, gctx->ivlen); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1173 |
+ gctx->iv_set = 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1174 |
+ gctx->iv_gen = 0; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1175 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1176 |
+ return 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1177 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1178 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1179 |
+#define aes_t4_gcm_cipher aes_gcm_cipher |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1180 |
+static int aes_t4_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1181 |
+ const unsigned char *in, size_t len); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1182 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1183 |
+static int aes_t4_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1184 |
+ const unsigned char *iv, int enc) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1185 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1186 |
+ EVP_AES_XTS_CTX *xctx = ctx->cipher_data; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1187 |
+ if (!iv && !key) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1188 |
+ return 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1189 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1190 |
+ if (key) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1191 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1192 |
+ int bits = ctx->key_len * 4; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1193 |
+ /* key_len is two AES keys */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1194 |
+ if (enc) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1195 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1196 |
+ aes_t4_set_encrypt_key(key, bits, &xctx->ks1.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1197 |
+ xctx->xts.block1 = (block128_f)aes_t4_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1198 |
+#if 0 /* not yet */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1199 |
+ switch (bits) { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1200 |
+ case 128: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1201 |
+ xctx->stream = aes128_t4_xts_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1202 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1203 |
+ case 192: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1204 |
+ xctx->stream = aes192_t4_xts_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1205 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1206 |
+ case 256: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1207 |
+ xctx->stream = aes256_t4_xts_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1208 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1209 |
+ default: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1210 |
+ return 0; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1211 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1212 |
+#endif |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1213 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1214 |
+ else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1215 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1216 |
+ aes_t4_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1217 |
+ xctx->xts.block1 = (block128_f)aes_t4_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1218 |
+#if 0 /* not yet */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1219 |
+ switch (bits) { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1220 |
+ case 128: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1221 |
+ xctx->stream = aes128_t4_xts_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1222 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1223 |
+ case 192: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1224 |
+ xctx->stream = aes192_t4_xts_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1225 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1226 |
+ case 256: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1227 |
+ xctx->stream = aes256_t4_xts_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1228 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1229 |
+ default: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1230 |
+ return 0; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1231 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1232 |
+#endif |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1233 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1234 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1235 |
+ aes_t4_set_encrypt_key(key + ctx->key_len/2, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1236 |
+ ctx->key_len * 4, &xctx->ks2.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1237 |
+ xctx->xts.block2 = (block128_f)aes_t4_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1238 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1239 |
+ xctx->xts.key1 = &xctx->ks1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1240 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1241 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1242 |
+ if (iv) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1243 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1244 |
+ xctx->xts.key2 = &xctx->ks2; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1245 |
+ memcpy(ctx->iv, iv, 16); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1246 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1247 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1248 |
+ return 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1249 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1250 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1251 |
+#define aes_t4_xts_cipher aes_xts_cipher |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1252 |
+static int aes_t4_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1253 |
+ const unsigned char *in, size_t len); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1254 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1255 |
+static int aes_t4_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1256 |
+ const unsigned char *iv, int enc) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1257 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1258 |
+ EVP_AES_CCM_CTX *cctx = ctx->cipher_data; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1259 |
+ if (!iv && !key) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1260 |
+ return 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1261 |
+ if (key) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1262 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1263 |
+ int bits = ctx->key_len * 8; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1264 |
+ aes_t4_set_encrypt_key(key, bits, &cctx->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1265 |
+ CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1266 |
+ &cctx->ks, (block128_f)aes_t4_encrypt); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1267 |
+#if 0 /* not yet */ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1268 |
+ switch (bits) { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1269 |
+ case 128: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1270 |
+ cctx->str = enc?(ccm128_f)aes128_t4_ccm64_encrypt : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1271 |
+ (ccm128_f)ae128_t4_ccm64_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1272 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1273 |
+ case 192: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1274 |
+ cctx->str = enc?(ccm128_f)aes192_t4_ccm64_encrypt : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1275 |
+ (ccm128_f)ae192_t4_ccm64_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1276 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1277 |
+ case 256: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1278 |
+ cctx->str = enc?(ccm128_f)aes256_t4_ccm64_encrypt : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1279 |
+ (ccm128_f)ae256_t4_ccm64_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1280 |
+ break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1281 |
+ default: |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1282 |
+ return 0; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1283 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1284 |
+#endif |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1285 |
+ cctx->key_set = 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1286 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1287 |
+ if (iv) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1288 |
+ { |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1289 |
+ memcpy(ctx->iv, iv, 15 - cctx->L); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1290 |
+ cctx->iv_set = 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1291 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1292 |
+ return 1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1293 |
+ } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1294 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1295 |
+#define aes_t4_ccm_cipher aes_ccm_cipher |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1296 |
+static int aes_t4_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1297 |
+ const unsigned char *in, size_t len); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1298 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1299 |
+#define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1300 |
+static const EVP_CIPHER aes_t4_##keylen##_##mode = { \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1301 |
+ nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1302 |
+ flags|EVP_CIPH_##MODE##_MODE, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1303 |
+ aes_t4_init_key, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1304 |
+ aes_t4_##mode##_cipher, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1305 |
+ NULL, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1306 |
+ sizeof(EVP_AES_KEY), \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1307 |
+ NULL,NULL,NULL,NULL }; \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1308 |
+static const EVP_CIPHER aes_##keylen##_##mode = { \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1309 |
+ nid##_##keylen##_##nmode,blocksize, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1310 |
+ keylen/8,ivlen, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1311 |
+ flags|EVP_CIPH_##MODE##_MODE, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1312 |
+ aes_init_key, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1313 |
+ aes_##mode##_cipher, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1314 |
+ NULL, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1315 |
+ sizeof(EVP_AES_KEY), \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1316 |
+ NULL,NULL,NULL,NULL }; \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1317 |
+const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1318 |
+{ return SPARC_AES_CAPABLE?&aes_t4_##keylen##_##mode:&aes_##keylen##_##mode; } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1319 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1320 |
+#define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags) \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1321 |
+static const EVP_CIPHER aes_t4_##keylen##_##mode = { \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1322 |
+ nid##_##keylen##_##mode,blocksize, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1323 |
+ (EVP_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE?2:1)*keylen/8, ivlen, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1324 |
+ flags|EVP_CIPH_##MODE##_MODE, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1325 |
+ aes_t4_##mode##_init_key, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1326 |
+ aes_t4_##mode##_cipher, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1327 |
+ aes_##mode##_cleanup, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1328 |
+ sizeof(EVP_AES_##MODE##_CTX), \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1329 |
+ NULL,NULL,aes_##mode##_ctrl,NULL }; \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1330 |
+static const EVP_CIPHER aes_##keylen##_##mode = { \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1331 |
+ nid##_##keylen##_##mode,blocksize, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1332 |
+ (EVP_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE?2:1)*keylen/8, ivlen, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1333 |
+ flags|EVP_CIPH_##MODE##_MODE, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1334 |
+ aes_##mode##_init_key, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1335 |
+ aes_##mode##_cipher, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1336 |
+ aes_##mode##_cleanup, \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1337 |
+ sizeof(EVP_AES_##MODE##_CTX), \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1338 |
+ NULL,NULL,aes_##mode##_ctrl,NULL }; \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1339 |
+const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1340 |
+{ return SPARC_AES_CAPABLE?&aes_t4_##keylen##_##mode:&aes_##keylen##_##mode; } |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1341 |
+ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1342 |
#else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1343 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1344 |
#define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1345 |
@@ -505,7 +879,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1346 |
#ifdef BSAES_CAPABLE |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1347 |
if (BSAES_CAPABLE && mode==EVP_CIPH_CBC_MODE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1348 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1349 |
- ret = AES_set_decrypt_key(key,ctx->key_len*8,&dat->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1350 |
+ ret = AES_set_decrypt_key(key,ctx->key_len*8,&dat->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1351 |
dat->block = (block128_f)AES_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1352 |
dat->stream.cbc = (cbc128_f)bsaes_cbc_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1353 |
} |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1354 |
@@ -514,7 +888,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1355 |
#ifdef VPAES_CAPABLE |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1356 |
if (VPAES_CAPABLE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1357 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1358 |
- ret = vpaes_set_decrypt_key(key,ctx->key_len*8,&dat->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1359 |
+ ret = vpaes_set_decrypt_key(key,ctx->key_len*8,&dat->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1360 |
dat->block = (block128_f)vpaes_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1361 |
dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1362 |
(cbc128_f)vpaes_cbc_encrypt : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1363 |
@@ -523,7 +897,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1364 |
else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1365 |
#endif |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1366 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1367 |
- ret = AES_set_decrypt_key(key,ctx->key_len*8,&dat->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1368 |
+ ret = AES_set_decrypt_key(key,ctx->key_len*8,&dat->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1369 |
dat->block = (block128_f)AES_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1370 |
dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1371 |
(cbc128_f)AES_cbc_encrypt : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1372 |
@@ -533,7 +907,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1373 |
#ifdef BSAES_CAPABLE |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1374 |
if (BSAES_CAPABLE && mode==EVP_CIPH_CTR_MODE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1375 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1376 |
- ret = AES_set_encrypt_key(key,ctx->key_len*8,&dat->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1377 |
+ ret = AES_set_encrypt_key(key,ctx->key_len*8,&dat->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1378 |
dat->block = (block128_f)AES_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1379 |
dat->stream.ctr = (ctr128_f)bsaes_ctr32_encrypt_blocks; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1380 |
} |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1381 |
@@ -542,7 +916,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1382 |
#ifdef VPAES_CAPABLE |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1383 |
if (VPAES_CAPABLE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1384 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1385 |
- ret = vpaes_set_encrypt_key(key,ctx->key_len*8,&dat->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1386 |
+ ret = vpaes_set_encrypt_key(key,ctx->key_len*8,&dat->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1387 |
dat->block = (block128_f)vpaes_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1388 |
dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1389 |
(cbc128_f)vpaes_cbc_encrypt : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1390 |
@@ -551,7 +925,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1391 |
else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1392 |
#endif |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1393 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1394 |
- ret = AES_set_encrypt_key(key,ctx->key_len*8,&dat->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1395 |
+ ret = AES_set_encrypt_key(key,ctx->key_len*8,&dat->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1396 |
dat->block = (block128_f)AES_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1397 |
dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1398 |
(cbc128_f)AES_cbc_encrypt : |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1399 |
@@ -825,7 +1199,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1400 |
#ifdef BSAES_CAPABLE |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1401 |
if (BSAES_CAPABLE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1402 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1403 |
- AES_set_encrypt_key(key,ctx->key_len*8,&gctx->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1404 |
+ AES_set_encrypt_key(key,ctx->key_len*8,&gctx->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1405 |
CRYPTO_gcm128_init(&gctx->gcm,&gctx->ks, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1406 |
(block128_f)AES_encrypt); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1407 |
gctx->ctr = (ctr128_f)bsaes_ctr32_encrypt_blocks; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1408 |
@@ -836,7 +1210,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1409 |
#ifdef VPAES_CAPABLE |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1410 |
if (VPAES_CAPABLE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1411 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1412 |
- vpaes_set_encrypt_key(key,ctx->key_len*8,&gctx->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1413 |
+ vpaes_set_encrypt_key(key,ctx->key_len*8,&gctx->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1414 |
CRYPTO_gcm128_init(&gctx->gcm,&gctx->ks, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1415 |
(block128_f)vpaes_encrypt); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1416 |
gctx->ctr = NULL; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1417 |
@@ -843,7 +1217,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1418 |
break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1419 |
} |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1420 |
#endif |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1421 |
- AES_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1422 |
+ AES_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1423 |
CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, (block128_f)AES_encrypt); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1424 |
#ifdef AES_CTR_ASM |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1425 |
gctx->ctr = (ctr128_f)AES_ctr32_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1426 |
@@ -1074,17 +1448,17 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1427 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1428 |
if (enc) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1429 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1430 |
- vpaes_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1431 |
+ vpaes_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1432 |
xctx->xts.block1 = (block128_f)vpaes_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1433 |
} |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1434 |
else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1435 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1436 |
- vpaes_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1437 |
+ vpaes_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1438 |
xctx->xts.block1 = (block128_f)vpaes_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1439 |
} |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1440 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1441 |
vpaes_set_encrypt_key(key + ctx->key_len/2, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1442 |
- ctx->key_len * 4, &xctx->ks2); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1443 |
+ ctx->key_len * 4, &xctx->ks2.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1444 |
xctx->xts.block2 = (block128_f)vpaes_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1445 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1446 |
xctx->xts.key1 = &xctx->ks1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1447 |
@@ -1093,17 +1467,17 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1448 |
#endif |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1449 |
if (enc) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1450 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1451 |
- AES_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1452 |
+ AES_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1453 |
xctx->xts.block1 = (block128_f)AES_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1454 |
} |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1455 |
else |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1456 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1457 |
- AES_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1458 |
+ AES_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1459 |
xctx->xts.block1 = (block128_f)AES_decrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1460 |
} |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1461 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1462 |
AES_set_encrypt_key(key + ctx->key_len/2, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1463 |
- ctx->key_len * 4, &xctx->ks2); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1464 |
+ ctx->key_len * 4, &xctx->ks2.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1465 |
xctx->xts.block2 = (block128_f)AES_encrypt; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1466 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1467 |
xctx->xts.key1 = &xctx->ks1; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1468 |
@@ -1214,7 +1588,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1469 |
#ifdef VPAES_CAPABLE |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1470 |
if (VPAES_CAPABLE) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1471 |
{ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1472 |
- vpaes_set_encrypt_key(key, ctx->key_len*8, &cctx->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1473 |
+ vpaes_set_encrypt_key(key, ctx->key_len*8, &cctx->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1474 |
CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1475 |
&cctx->ks, (block128_f)vpaes_encrypt); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1476 |
cctx->str = NULL; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1477 |
@@ -1222,7 +1596,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1478 |
break; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1479 |
} |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1480 |
#endif |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1481 |
- AES_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1482 |
+ AES_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks.ks); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1483 |
CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1484 |
&cctx->ks, (block128_f)AES_encrypt); |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1485 |
cctx->str = NULL; |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1486 |
@@ -1310,5 +1684,4 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1487 |
BLOCK_CIPHER_custom(NID_aes,192,1,12,ccm,CCM,EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1488 |
BLOCK_CIPHER_custom(NID_aes,256,1,12,ccm,CCM,EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS) |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1489 |
|
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1490 |
-#endif |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1491 |
#endif |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1492 |
Index: openssl/crypto/evp/evp.h |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1493 |
=================================================================== |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1494 |
--- evp.h Mon Feb 11 07:26:04 2013 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1495 |
+++ evp.h.new Thu May 2 14:31:55 2013 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1496 |
@@ -1256,6 +1256,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1497 |
#define EVP_F_AESNI_INIT_KEY 165 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1498 |
#define EVP_F_AESNI_XTS_CIPHER 176 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1499 |
#define EVP_F_AES_INIT_KEY 133 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1500 |
+#define EVP_F_AES_T4_INIT_KEY 178 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1501 |
#define EVP_F_AES_XTS 172 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1502 |
#define EVP_F_AES_XTS_CIPHER 175 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1503 |
#define EVP_F_ALG_MODULE_INIT 177 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1504 |
Index: openssl/crypto/evp/evp_err.c |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1505 |
=================================================================== |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1506 |
--- evp_err.c Mon Feb 11 07:26:04 2013 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1507 |
+++ evp_err.c.new Thu May 2 14:33:24 2013 |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1508 |
@@ -73,6 +73,7 @@ |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1509 |
{ERR_FUNC(EVP_F_AESNI_INIT_KEY), "AESNI_INIT_KEY"}, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1510 |
{ERR_FUNC(EVP_F_AESNI_XTS_CIPHER), "AESNI_XTS_CIPHER"}, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1511 |
{ERR_FUNC(EVP_F_AES_INIT_KEY), "AES_INIT_KEY"}, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1512 |
+{ERR_FUNC(EVP_F_AES_T4_INIT_KEY), "AES_T4_INIT_KEY"}, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1513 |
{ERR_FUNC(EVP_F_AES_XTS), "AES_XTS"}, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1514 |
{ERR_FUNC(EVP_F_AES_XTS_CIPHER), "AES_XTS_CIPHER"}, |
af3d6ef22d65
PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
1294
diff
changeset
|
1515 |
{ERR_FUNC(EVP_F_ALG_MODULE_INIT), "ALG_MODULE_INIT"}, |