Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
e4bbee96
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e4bbee96
编写于
12月 06, 2014
作者:
M
Matt Caswell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add documentation for OCB mode
Reviewed-by:
N
Tim Hudson
<
tjh@openssl.org
>
上级
d827c5ed
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
13 deletion
+31
-13
doc/crypto/EVP_EncryptInit.pod
doc/crypto/EVP_EncryptInit.pod
+31
-13
未找到文件。
doc/crypto/EVP_EncryptInit.pod
浏览文件 @
e4bbee96
...
...
@@ -368,7 +368,13 @@ bits and 12 rounds.
AES Galois Counter Mode (GCM) for 128, 192 and 256 bit keys respectively.
These ciphers require additional control operations to function correctly: see
L<GCM mode> section below for details.
the L<GCM and OCB modes> section below for details.
=item EVP_aes_128_ocb(void), EVP_aes_192_ocb(void), EVP_aes_256_ocb(void)
Offest Codebook Mode (OCB) for 128, 192 and 256 bit keys respectively.
These ciphers require additional control operations to function correctly: see
the L<GCM and OCB modes> section below for details.
=item EVP_aes_128_ccm(), EVP_aes_192_ccm(), EVP_aes_256_ccm()
...
...
@@ -378,10 +384,10 @@ CCM mode section below for details.
=back
=head1 GCM
Mode
=head1 GCM
and OCB Modes
For GCM
mode ciphers the behaviour of the EVP interface is subtly altered and
several GCM specific
ctrl operations are supported.
For GCM
and OCB mode ciphers the behaviour of the EVP interface is subtly
altered and several additional
ctrl operations are supported.
To specify any additional authenticated data (AAD) a call to EVP_CipherUpdate(),
EVP_EncryptUpdate() or EVP_DecryptUpdate() should be made with the output
...
...
@@ -392,24 +398,35 @@ indicates if the operation was successful. If it does not indicate success
the authentication operation has failed and any output data B<MUST NOT>
be used as it is corrupted.
The following ctrls are supported in GCM mode:
The following ctrl is supported in OCB mode only:
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_OCB_SET_TAGLEN, taglen, NULL);
Sets the tag length: this call can only be made before specifying an IV. If
not called a default tag length is used. For OCB AES the default is 16 (i.e. 128
bits). This is also the maximum tag length.
The following ctrls are supported in both GCM and OCB modes:
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_
GCM_
SET_IVLEN, ivlen, NULL);
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_IVLEN, ivlen, NULL);
Sets the GCM IV length: this call can only be made before specifying an IV. If
not called a default IV length is used (96 bits for AES).
Sets the IV length: this call can only be made before specifying an IV. If
not called a default IV length is used. For GCM AES and OCB AES the default is
12 (i.e. 96 bits). For OCB mode the maximum is 15.
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_G
CM_G
ET_TAG, taglen, tag);
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_TAG, taglen, tag);
Writes B<taglen> bytes of the tag value to the buffer indicated by B<tag>.
This call can only be made when encrypting data and B<after> all data has been
processed (e.g. after an EVP_EncryptFinal() call).
processed (e.g. after an EVP_EncryptFinal() call). For OCB mode the taglen must
either be 16 or the value previously set via EVP_CTRL_OCB_SET_TAGLEN.
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_
GCM_
SET_TAG, taglen, tag);
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_TAG, taglen, tag);
Sets the expected tag to B<taglen> bytes from B<tag>. This call is only legal
when decrypting data and must be made B<before> any data is processed (e.g.
before any EVP_DecryptUpdate() call).
before any EVP_DecryptUpdate() call). For OCB mode the taglen must
either be 16 or the value previously set via EVP_CTRL_OCB_SET_TAGLEN.
See L<EXAMPLES> below for an example of the use of GCM mode.
...
...
@@ -418,7 +435,7 @@ See L<EXAMPLES> below for an example of the use of GCM mode.
The behaviour of CCM mode ciphers is similar to CCM mode but with a few
additional requirements and different ctrl values.
Like GCM
mode
any additional authenticated data (AAD) is passed by calling
Like GCM
and OCB modes
any additional authenticated data (AAD) is passed by calling
EVP_CipherUpdate(), EVP_EncryptUpdate() or EVP_DecryptUpdate() with the output
parameter B<out> set to B<NULL>. Additionally the total plaintext or ciphertext
length B<MUST> be passed to EVP_CipherUpdate(), EVP_EncryptUpdate() or
...
...
@@ -607,4 +624,5 @@ OpenSSL 0.9.7.
IDEA appeared in OpenSSL 0.9.7 but was often disabled due to
patent concerns; the last patents expired in 2012.
Support for OCB mode was added in OpenSSL 1.1.0
=cut
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录