Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
9139353f
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9139353f
编写于
4月 22, 2015
作者:
A
amurillo
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
e95ef7a9
ad7ff889
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
2 deletion
+18
-2
src/share/classes/com/sun/crypto/provider/GCTR.java
src/share/classes/com/sun/crypto/provider/GCTR.java
+18
-2
未找到文件。
src/share/classes/com/sun/crypto/provider/GCTR.java
浏览文件 @
9139353f
...
...
@@ -38,7 +38,17 @@ import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
* under section 6.5. It needs to be constructed w/ an initialized
* cipher object, and initial counter block(ICB). Given an input X
* of arbitrary length, it processes and returns an output which has
* the same length as X.
* the same length as X. The invariants of this class are:
*
* (1) The length of intialCounterBlk (and also of its clones, e.g.,
* fields counter and counterSave) is equal to AES_BLOCK_SIZE.
*
* (2) After construction, the field counter never becomes null, it
* always contains a byte array of length AES_BLOCK_SIZE.
*
* If any invariant is broken, failures can occur because the
* AESCrypt.encryptBlock method can be intrinsified on the HotSpot VM
* (see JDK-8067648 for details).
*
* <p>This function is used in the implementation of GCM mode.
*
...
...
@@ -59,6 +69,10 @@ final class GCTR {
// NOTE: cipher should already be initialized
GCTR
(
SymmetricCipher
cipher
,
byte
[]
initialCounterBlk
)
{
this
.
aes
=
cipher
;
if
(
initialCounterBlk
.
length
!=
AES_BLOCK_SIZE
)
{
throw
new
RuntimeException
(
"length of initial counter block ("
+
initialCounterBlk
.
length
+
") not equal to AES_BLOCK_SIZE ("
+
AES_BLOCK_SIZE
+
")"
);
}
this
.
icb
=
initialCounterBlk
;
this
.
counter
=
icb
.
clone
();
}
...
...
@@ -137,6 +151,8 @@ final class GCTR {
* Restores the content of this object to the previous saved one.
*/
void
restore
()
{
this
.
counter
=
this
.
counterSave
;
if
(
this
.
counterSave
!=
null
)
{
this
.
counter
=
this
.
counterSave
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录