0

我想为我的学期项目重新实施一篇关于 s-box 的研究论文,但我现在时间不多。我的职责是用不同的 sbox 测试不同的 aes 模式(如 cbc、ecb、ctr、gcm)。我为此目的使用 openssl 库 1.0.1i。显然我需要生成查找表,为此这篇文章很有帮助

生成 AES (AES-256) 查找表

现在我必须嵌入这些表。我浏览了 openssl 库,发现 aes_core.c 具有所有查找表和 crypto_cbc128_encrypt() 使用的有用函数以及 aes/... 中的其他模式源文件...编译成功但对于 GCM_AES_256 我被卡住了。我无法找到像 aes_cbc、aes_ctr 等 GCM_aes_256 源文件。它的实现方式不同吗?由于 aes 在所有模式中都使用,因此最终应该从 aes_core 文件中使用相同的查找表。不是这样吗?它在openssl中的实现方式不同吗?

在 Openssl 文件中,我在 gcm_128 中看到了 Htables。这些表有什么作用?他们是否指向与 aescore 中相同的查找表?

4

1 回答 1

0

Have you looked at 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).

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.

enter image description here

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).

于 2014-09-02T20:31:31.383 回答