0

I want to re-implement a research paper for s-boxes for my semester project and I am short of time now. My part is to test different modes of aes (like cbc,ecb,ctr,gcm) with different sboxes. I am using openssl library 1.0.1i for the purpose. Obviously I need to generate lookup tables and for that this post was helpful

Generating AES (AES-256) Lookup Tables

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. I am unable to locate a GCM_aes_256 source file like aes_cbc, aes_ctr etc. Is it implemented differently?? As aes is used in all modes so finally same lookup tables should be used from aes_core file. Isnt it the case? Is it implemented differently in openssl??

Additional in Openssl files, I have seen Htables in gcm_128. What do these tables do? Are they pointing to same lookup tables as in aescore?

Community
  • 1
  • 1
Eshaal
  • 125
  • 2
  • 13
  • I hope you are better with substitution boxes than you are with Google. Note that any of the modes you mention rely on *block encryption* provided by the AES cipher. The AES cipher *internally* uses sboxes so I'm not so sure where you are heading with your project. – Maarten Bodewes Sep 02 '14 at 20:32

1 Answers1

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

Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263