简体   繁体   English

Openssl AES GCM-256桌子

[英]Openssl AES GCM-256 Htables

I want to re-implement a research paper for s-boxes for my semester project and I am short of time now. 我想为我的学期项目重新实现S-Box的研究论文,但我现在没有时间了。 My part is to test different modes of aes (like cbc,ecb,ctr,gcm) with different sboxes. 我的部分是用不同的盒子测试不同模式的AES(例如cbc,ecb,ctr,gcm)。 I am using openssl library 1.0.1i for the purpose. 我为此目的使用openssl库1.0.1i。 Obviously I need to generate lookup tables and for that this post was helpful 显然,我需要生成查找表,为此,这篇文章很有帮助

Generating AES (AES-256) Lookup Tables 生成AES(AES-256)查找表

Now I have to embed those tables. 现在,我必须嵌入这些表。 I have gone through the openssl library and found aes_core.c having all lookup tables and useful functions used by crypto_cbc128_encrypt() and other modes sources files in aes/... Compilation was successful but for GCM_AES_256 I am stuck. 我浏览了openssl库,发现aes_core.c具有所有查找表以及crypto_cbc128_encrypt()和其他模式在aes /中使用的源文件使用的有用函数。编译成功,但对于GCM_AES_256,我遇到了麻烦。 I am unable to locate a GCM_aes_256 source file like aes_cbc, aes_ctr etc. Is it implemented differently?? 我无法找到aes_cbc,aes_ctr等GCM_aes_256源文件。实现方式是否有所不同? As aes is used in all modes so finally same lookup tables should be used from aes_core file. 由于在所有模式下都使用aes,因此最终应从aes_core文件中使用相同的查找表。 Isnt it the case? 是不是这样? Is it implemented differently in openssl?? 在openssl中实现的方式有所不同吗?

Additional in Openssl files, I have seen Htables in gcm_128. 在Openssl文件中,我在gcm_128中看到了Htables。 What do these tables do? 这些表做什么? Are they pointing to same lookup tables as in aescore? 他们是否指向与aescore中相同的查找表?

Have you looked at gcm128.c ? 您看过gcm128.c吗?

The HTables are you are pointing to are specific to Galois/Counter mode (GCM) to perform Galois field multiplication (mult_H in the picture below). 您要指向的HTables特定于Galois /计数器模式(GCM)以执行Galois字段乘法(下图中的mult_H)。

In contrast with CCM and EAX modes of operation, GCM mode only uses the AES block cipher to create the final GHASH value using the encryption of block 0. 与CCM和EAX操作模式相比,GCM模式仅使用AES块密码通过对块0进行加密来创建最终的GHASH值。

在此处输入图片说明

So you either have a learning curve with regards to GCM mode or you could choose one of the other ciphers with authentication instead (CCM uses CBC-MAC, EAX uses CMAC). 因此,您可以选择关于GCM模式的学习曲线,也可以选择其他具有身份验证的密码(CCM使用CBC-MAC,EAX使用CMAC)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM