Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
63018017
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
63018017
编写于
7月 10, 2015
作者:
A
ascarpino
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8130341: GHASH 32bit intrinsics has AEADBadTagException
Reviewed-by: kvn, mcberg Contributed-by: ygaevsky@azul.com
上级
7672a6d1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
21 deletion
+39
-21
src/cpu/x86/vm/stubGenerator_x86_32.cpp
src/cpu/x86/vm/stubGenerator_x86_32.cpp
+2
-0
test/compiler/7184394/TestAESBase.java
test/compiler/7184394/TestAESBase.java
+31
-19
test/compiler/7184394/TestAESDecode.java
test/compiler/7184394/TestAESDecode.java
+5
-1
test/compiler/7184394/TestAESEncode.java
test/compiler/7184394/TestAESEncode.java
+1
-1
未找到文件。
src/cpu/x86/vm/stubGenerator_x86_32.cpp
浏览文件 @
63018017
...
...
@@ -2772,6 +2772,7 @@ class StubGenerator: public StubCodeGenerator {
const
XMMRegister
xmm_temp7
=
xmm7
;
__
enter
();
handleSOERegisters
(
true
);
// Save registers
__
movptr
(
state
,
state_param
);
__
movptr
(
subkeyH
,
subkeyH_param
);
...
...
@@ -2875,6 +2876,7 @@ class StubGenerator: public StubCodeGenerator {
__
pshufb
(
xmm_temp6
,
ExternalAddress
(
StubRoutines
::
x86
::
ghash_long_swap_mask_addr
()));
__
movdqu
(
Address
(
state
,
0
),
xmm_temp6
);
// store the result
handleSOERegisters
(
false
);
// restore registers
__
leave
();
__
ret
(
0
);
return
start
;
...
...
test/compiler/7184394/TestAESBase.java
浏览文件 @
63018017
...
...
@@ -63,12 +63,12 @@ abstract public class TestAESBase {
Random
random
=
new
Random
(
0
);
Cipher
cipher
;
Cipher
dCipher
;
AlgorithmParameters
algParams
;
AlgorithmParameters
algParams
=
null
;
SecretKey
key
;
GCMParameterSpec
gcm_spec
;
byte
[]
aad
;
byte
[]
aad
=
{
0x11
,
0x22
,
0x33
,
0x44
,
0x55
}
;
int
tlen
=
12
;
byte
[]
iv
;
byte
[]
iv
=
new
byte
[
16
]
;
static
int
numThreads
=
0
;
int
threadId
;
...
...
@@ -82,7 +82,10 @@ abstract public class TestAESBase {
public
void
prepare
()
{
try
{
System
.
out
.
println
(
"\nalgorithm="
+
algorithm
+
", mode="
+
mode
+
", paddingStr="
+
paddingStr
+
", msgSize="
+
msgSize
+
", keySize="
+
keySize
+
", noReinit="
+
noReinit
+
", checkOutput="
+
checkOutput
+
", encInputOffset="
+
encInputOffset
+
", encOutputOffset="
+
encOutputOffset
+
", decOutputOffset="
+
decOutputOffset
+
", lastChunkSize="
+
lastChunkSize
);
System
.
out
.
println
(
"\nalgorithm="
+
algorithm
+
", mode="
+
mode
+
", paddingStr="
+
paddingStr
+
", msgSize="
+
msgSize
+
", keySize="
+
keySize
+
", noReinit="
+
noReinit
+
", checkOutput="
+
checkOutput
+
", encInputOffset="
+
encInputOffset
+
", encOutputOffset="
+
encOutputOffset
+
", decOutputOffset="
+
decOutputOffset
+
", lastChunkSize="
+
lastChunkSize
);
if
(
encInputOffset
%
ALIGN
!=
0
||
encOutputOffset
%
ALIGN
!=
0
||
decOutputOffset
%
ALIGN
!=
0
)
testingMisalignment
=
true
;
...
...
@@ -103,22 +106,24 @@ abstract public class TestAESBase {
cipher
=
Cipher
.
getInstance
(
algorithm
+
"/"
+
mode
+
"/"
+
paddingStr
,
"SunJCE"
);
dCipher
=
Cipher
.
getInstance
(
algorithm
+
"/"
+
mode
+
"/"
+
paddingStr
,
"SunJCE"
);
// CBC init
if
(
mode
.
equals
(
"CBC"
))
{
int
ivLen
=
(
algorithm
.
equals
(
"AES"
)
?
16
:
algorithm
.
equals
(
"DES"
)
?
8
:
0
);
IvParameterSpec
initVector
=
new
IvParameterSpec
(
new
byte
[
ivLen
]);
IvParameterSpec
initVector
=
new
IvParameterSpec
(
iv
);
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
key
,
initVector
);
algParams
=
cipher
.
getParameters
();
dCipher
.
init
(
Cipher
.
DECRYPT_MODE
,
key
,
initVector
);
// GCM init
}
else
if
(
mode
.
equals
(
"GCM"
))
{
iv
=
new
byte
[
64
];
random
.
nextBytes
(
iv
);
aad
=
new
byte
[
5
];
random
.
nextBytes
(
aad
);
gcm_init
();
gcm_init
(
true
);
gcm_init
(
false
);
// ECB init
}
else
{
algParams
=
cipher
.
getParameters
();
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
key
,
algParams
);
dCipher
.
init
(
Cipher
.
DECRYPT_MODE
,
key
,
algParams
);
}
algParams
=
cipher
.
getParameters
();
dCipher
.
init
(
Cipher
.
DECRYPT_MODE
,
key
,
algParams
);
if
(
threadId
==
0
)
{
childShowCipher
();
}
...
...
@@ -200,11 +205,18 @@ abstract public class TestAESBase {
abstract
void
childShowCipher
();
void
gcm_init
()
throws
Exception
{
tlen
=
12
;
void
gcm_init
(
boolean
encrypt
)
throws
Exception
{
gcm_spec
=
new
GCMParameterSpec
(
tlen
*
8
,
iv
);
cipher
=
Cipher
.
getInstance
(
algorithm
+
"/"
+
mode
+
"/"
+
paddingStr
,
"SunJCE"
);
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
key
,
gcm_spec
);
cipher
.
update
(
aad
);
if
(
encrypt
)
{
// Get a new instance everytime because of reuse IV restrictions
cipher
=
Cipher
.
getInstance
(
algorithm
+
"/"
+
mode
+
"/"
+
paddingStr
,
"SunJCE"
);
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
key
,
gcm_spec
);
cipher
.
updateAAD
(
aad
);
}
else
{
dCipher
.
init
(
Cipher
.
DECRYPT_MODE
,
key
,
gcm_spec
);
dCipher
.
updateAAD
(
aad
);
}
}
}
test/compiler/7184394/TestAESDecode.java
浏览文件 @
63018017
...
...
@@ -32,7 +32,11 @@ public class TestAESDecode extends TestAESBase {
@Override
public
void
run
()
{
try
{
if
(!
noReinit
)
dCipher
.
init
(
Cipher
.
DECRYPT_MODE
,
key
,
algParams
);
if
(
mode
.
equals
(
"GCM"
))
{
gcm_init
(
false
);
}
else
if
(!
noReinit
)
{
dCipher
.
init
(
Cipher
.
DECRYPT_MODE
,
key
,
algParams
);
}
decode
=
new
byte
[
decodeLength
];
if
(
testingMisalignment
)
{
int
tempSize
=
dCipher
.
update
(
encode
,
encOutputOffset
,
(
decodeMsgSize
-
lastChunkSize
),
decode
,
decOutputOffset
);
...
...
test/compiler/7184394/TestAESEncode.java
浏览文件 @
63018017
...
...
@@ -33,7 +33,7 @@ public class TestAESEncode extends TestAESBase {
public
void
run
()
{
try
{
if
(
mode
.
equals
(
"GCM"
))
{
gcm_init
();
gcm_init
(
true
);
}
else
if
(!
noReinit
)
{
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
key
,
algParams
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录